The git server I am trying to pull has a new branch . (call it branch-9)
In my local, I don't have that and I do I pull it to my local computer?
should I run this?
$git checkout -b branch-9 $git pull branch-9 is that the right way?
Doing a git fetch will, if you have configured the git server as a remote, create a local tracking branch.
git fetch git checkout branch-9 # This will automatically set up to track "origin/branch-9" The long form of the above command is:
git fetch git checkout -b branch-9 origin/branch-9 after you've started making local changes to your copy of branch-9, then you might want to use git pull. git pull is the same as git fetch and either git merge or git rebase (depending on your settings, defaulting to git merge).
First get a local copy of the remote branch:
git fetch This will create origin/branch-9. Now check-out a branch-9:
git checkout branch-9 This will create a new local branch that tracks the remote branch.