Last active

Git Checkout branch locally from remote

  • Download Gist
1 2 3 4 5 6
# fetch branch if not in local and not tracked
git fetch origin remote_branch_name:local_branch_name
# checkout branch locally if branch is tracked after
# git status
git checkout -b local-name origin/remote-name

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.