Developer A is working on branch 2012A
I branch 2012A, and create branch 2012B
I want all the new changes from 2012A, so I simply want to merge them into 2012B and carry on working.
Does this look ok as a workflow?
git checkout 2012A (switch to 2012A)
git pull origin 2012A (update 2012A)
git checkout 2012B (switch to 2012B)
git merge 2012A (merge in 2012A)
git commit -m 'commiting changes from 2012A' (commit changes from 2012A in 2012B)
Thanks in advance,
It should work, however you could do it in a simpler way:
directly from branch
2012B:Note that you are not required to have a local branch for
2012A: if have a repository in your remotes (here your remote isorigin) you usually carry the snapshots of the remote branches. You can see them by running:(See the
remotes/...entries of the output)The
git fetchcommand updates the snapshots, sogit fetch originupdates your local images of the remote branches inorigin, andgit merge origin/2012Amerges such image into the current branch (i.e. applies the patches oforigin/2012Aon2012B).Suggested article:
http://longair.net/blog/2009/04/16/git-fetch-and-merge/