Created
May 2, 2026 15:02
-
-
Save kgleason/c7b04fe801eb1f5367168b6645d99d14 to your computer and use it in GitHub Desktop.
Move a branch between 2 machines without pushing to a central repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Scenario: You have a git branch on a laptop, and you need it moved to a desktop without pushing to a central repo. | |
| # Change out the values as necessary. | |
| # On your laptop: | |
| git bundle create /tmp/branch-name.bundle branch-name | |
| scp /tmp/branch-name.bundle desktop:/tmp/ | |
| # On the desktop machine: | |
| cd ~/project/repo | |
| git fetch /tmp/branch-name.bundle branch-name:branch-name | |
| git checkout branch-name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment