How do I:
-
Create a local branch from another branch (via
git branch
orgit checkout -b
). -
Push the local branch
to the remote repository (i.e. publish), but make it
trackable so thatgit pull
andgit push
will work.
gitgit-branchgit-pushgit-remoterepository
How do I:
Create a local branch from another branch (via git branch
or git checkout -b
).
Push the local branch
to the remote repository (i.e. publish), but make it
trackable so that git pull
and git push
will work.
Best Answer
In Git 1.7.0 and later, you can checkout a new branch:
Edit files, add and commit. Then push with the
-u
(short for--set-upstream
) option:Git will set up the tracking information during the push.