How do I push a new local branch to a remote Git repository and track it too?

asked15 years ago
last updated3 years ago
viewed5.3m times
Up Vote5.4kDown Vote

How do I:

  1. Create a local branch from another branch (via git branch or git checkout -b).
  2. Push the local branch to the remote repository (i.e. publish), but make it trackable so that git pull and git push will work.