I have a git repository that contains two branches, 1.0 and master. If I want to work with 1.0, I clone it using the following command:
git clone ssh://user@server/project -b 1.0 project-1.0
And everything's good. If I issue a command git branch, I see:
1.0
git branch -a as follows:
* 1.0
remotes/origin/1.0
remotes/origin/HEAD -> origin/master
remotes/origin/master
However, if someone else pushes the changes to master, and I make changes to 1.0 and try to push, it will fail because I need to update my repo with the main changes. To do this, checkout wizard, pull the changes, and then go back to 1.0:
git checkout master
git pull
git checkout 1.0
However, is there an easier way so that I can make the latest changes without prior control?
source
share