Skip to content

Instantly share code, notes, and snippets.

@kgleason
Created May 2, 2026 15:02
Show Gist options
  • Select an option

  • Save kgleason/c7b04fe801eb1f5367168b6645d99d14 to your computer and use it in GitHub Desktop.

Select an option

Save kgleason/c7b04fe801eb1f5367168b6645d99d14 to your computer and use it in GitHub Desktop.
Move a branch between 2 machines without pushing to a central repo
# 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