Skip to content

Instantly share code, notes, and snippets.

@mehmetkurt
Created November 1, 2018 09:31
Show Gist options
  • Save mehmetkurt/6ca999bdad903f15f5eff1abd453e929 to your computer and use it in GitHub Desktop.
Save mehmetkurt/6ca999bdad903f15f5eff1abd453e929 to your computer and use it in GitHub Desktop.
Git push a new local branch to a remote Git repository and track it too?
In Git 1.7.0 and later, you can checkout a new branch:
git checkout -b <branch>
Edit files, add and commit. Then push with the -u (short for --set-upstream) option:
git push -u origin <branch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment