You don't fetch a branch, you fetch
a remote, so the correct line would be
git fetch origin # or whatever your remote is called
Then the all tracking branches are updated, your updated code will be it a branch called origin/myDevBranch
, again origin is replaced with your upstream name
To update your local branch you can merge the upstream git merge origin/myDevBranch
but you need to make sure that your HEAD
is pointing to your local branch of this remote (aka myDevBranch),
Or you can checkout to it git checkout origin/myDevBranch
but that would leave you in a detached head mode, you can create a new local branch from that remote using git checkout -b
If your HEAD
is pointing to your current branch, then you can do a git pull
, keep in mind that pull
will do both fetch
and merge
, and if your branch has diverged for any reason you would get a conflict
that you will need to resolve by your self.
If you need to rebase
then you could either do a manual fetch
and rebase
or you could do a git pull --rebase