You can migrate the repository with its branches, tags, and commit history, but you must review service settings and Bitbucket-specific data separately.
Method 1: Via GitHub Desktop
After cloning, the repository contains a .git folder with a remote pointing to Bitbucket โ the Publish Repository button won’t appear. You need to delete .git and create a new repository:
- Clone the repository: File โ Clone Repository โ URL โ paste the Bitbucket HTTPS URL โ Clone
- Open the repository folder in Explorer (Windows) or Finder (macOS)
- Show hidden files and delete the
.gitfolder:
- Windows: View โ Hidden items โ delete the.gitfolder
- macOS: Cmd+Shift+. (dot) โ delete the.gitfolder to Trash - Switch back to GitHub Desktop โ it will show a ยซCan’t find …ยป screen. Click Remove
- Add the folder as a new repository:
- Windows: File โ New Repository… โ Name: folder name โ Local Path: parent folder โ Create Repository
- macOS: Current Repository โ Add โ Create New Repository… โ Name: folder name โ Local Path: parent folder โ Create Repository - Click Publish Repository โ uncheck Keep this code private โ Publish Repository
Commit history is not preserved with this method. To migrate history โ use Method 2 or 3.
Method 2: Git Mirror via Command Line
# 1. Clone from Bitbucket
git clone --bare https://bitbucket.org/username/repo.git
# 2. Mirror push to GitHub
cd repo.git
git push --mirror https://github.com/username/repo.git
# 3. Remove the temporary folder and clone from GitHub
cd ..
rm -rf repo.git
git clone https://github.com/username/repo.git
--bare โ Git data only. --mirror โ copies all branches, tags, and full history.
Method 3: GitHub Import
- Go to github.com/new/import
- Paste the Bitbucket URL
- If needed, enter credentials (App Password for Bitbucket with 2FA)
- Choose a repository name, Public/Private โ Begin import
What Transfers
| Transfers | Does NOT transfer |
|---|---|
| Code | Issues |
| Commit history | Pull Requests |
| All branches | Pipelines |
| Tags | Wiki |
| Commit authors | Branch permissions |
After Migration
Set up GitHub Actions (replacing Bitbucket Pipelines):
# .github/workflows/ci.yml
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: npm test
Update the remote for team members:
git remote set-url origin https://github.com/username/repo.git
git fetch
Also update: README links, CI/CD secrets, webhooks, documentation.
Platform Comparison
| Feature | Bitbucket | GitHub |
|---|---|---|
| Free private repos | โ | โ |
| CI/CD | Pipelines | Actions |
| Free CI/CD minutes | 50/mo | 2000/mo |
| Community | Smaller | 100M+ |
| Jira integration | Excellent | Available but weaker |
| Self-hosted | Bitbucket Server | GitHub Enterprise |
Common Issues
Authentication failed with 2FA: use an App Password instead of your regular password (Bitbucket โ Personal Settings โ App Passwords).
Large repository (> 1 GB): remove large files with git filter-branch or BFG Repo-Cleaner before migrating.
๐ฌ Comments (0)
No comments yet
Be the first to share your opinion about this article!