Something happened to me last time when I created a new branch using the -b otions with two args:
I created a branch from master like this
git checkout -b test remotes/origin/master
This created a branch but it also set my configs like this:
branch.test.remote=origin
branch.test.merge=refs/heads/master
I pushed my new branch to github and I kept doing some work in my test branch. After a while I had to add something to my master branch so I did and push.
then I swicthed to my test branch and after doing a git pull I got the changes in my test branch. I assume this has to do on how I created the branches and how the configs are set.
I tried to look up for an explanation but I only see that the second parameter is .
Can someone explain what exactly happened here ?
Thanks
You are correct. You did not do things the way they are usually done and test is now tracking master. What you want to do is add the parameter to the
checkout -bcommand to not setup tracking for the branch. Then when you want to push test up to the server, make it track a remote test branch by doinggit push -u origin test.