I am a Mercurial user, and I am confused about the behaviour of remote branches. I have a remote branch origin/dev
, and I want to replicate it on a local branche dev
. What I would like is that:
- whenever I
git pull
, changes toorigin/dev
are merged intodev
- whenever I
git push
, changes todev
are merged intoorigin/dev
So I created a tracking branch with
git branch --track dev origin/dev
which, to the best of my knowledge, should do exactly what I need.
Still, I was working on a feature branch and issued a git pull
. When I later issued git checkout dev
I received the puzzling message
Your branch is behind 'origin/master_dev' by 2 commits, and can be fast-forwarded.
So it seems that my local branch was not updated after all. Is there a way to have the branch updated to the remote one whenever I pull and I am not currently in that branch? If not, am I correct that git merge
(without any arguments) on branch dev is enough to restore the situation?