๐Ÿ“ Git & GitHub

Migrating from Bitbucket to GitHub

P
Author
PyLand Team
๐Ÿ“…
Published
06.05.2026
โฑ๏ธ
Reading time
2 min
๐Ÿ‘๏ธ
Views
418
๐Ÿ†
Level
Expert

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:

  1. Clone the repository: File โ†’ Clone Repository โ†’ URL โ†’ paste the Bitbucket HTTPS URL โ†’ Clone
  2. Open the repository folder in Explorer (Windows) or Finder (macOS)
  3. Show hidden files and delete the .git folder:
    - Windows: View โ†’ Hidden items โ†’ delete the .git folder
    - macOS: Cmd+Shift+. (dot) โ†’ delete the .git folder to Trash
  4. Switch back to GitHub Desktop โ€” it will show a ยซCan’t find …ยป screen. Click Remove
  5. 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
  6. 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

  1. Go to github.com/new/import
  2. Paste the Bitbucket URL
  3. If needed, enter credentials (App Password for Bitbucket with 2FA)
  4. 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.

Your reaction to the article

๐Ÿ’ฌ Comments (0)

๐Ÿ” Sign in to leave a comment
๐Ÿšช Login
๐Ÿ’ญ

No comments yet

Be the first to share your opinion about this article!

๐Ÿ”— Similar

Similar articles

Continue learning with these materials

๐Ÿ“

Undo and Revert in GitHub Desktop: Fix Mistakes Wโ€ฆ

A commit is not a point of no return. GitHub Desktop lets you rebuild a...

๐Ÿ“… 16.07.2026 ๐Ÿ‘๏ธ 358
๐Ÿ“

History, Diffs, and Web Commits on GitHub

GitHub lets you read repository history, inspect individual commit diffs, view the history of one...

๐Ÿ“… 16.07.2026 ๐Ÿ‘๏ธ 311
๐Ÿ“

Your First Git Commit

Your first commit starts with initializing a repository, configuring the author identity, and selecting the...

๐Ÿ“… 30.06.2026 ๐Ÿ‘๏ธ 341
๐ŸŽ“ Continue learning

Courses that cover this material

Visit the course to apply this material in practice.

Git & GitHub Desktop: Teamwork Without the Pain Open course curriculum