Topic: Git branches

Not sure this is the right place for questions about git, but...

I use branches, a great feature of git. I have a test branch and the master branch. After I checkout and go into the master branch again and merge test into master and do a commit, what happens to test? Can I use that again, that is will it use the new master or will it be the same as before I merged it with master?

Re: Git branches

This should answer your question: http://www.kernel.org/pub/software/scm/ … orial.html

But short answer is yes they will continue to be separate.

Re: Git branches

naegles wrote:

This should answer your question: http://www.kernel.org/pub/software/scm/ … orial.html

But short answer is yes they will continue to be separate.

Not quite. I can't find an answer to my question. Only that I can destroy a branch with -D and then create it again with the same name.

Separate yes. But different? After a merge, shouldn't they be the same?

Re: Git branches

Oh sorry...the answer is yes and no.

When you merge your test branch with the master, the master will receive all the code changes you made in the test branch, However, if you make changes to the master branch and your test branch, then the changes from the test branch will be merged into the master branch, but the test branch will not have the changes you made in the master branch.

Re: Git branches

naegles wrote:

Oh sorry...the answer is yes and no.

When you merge your test branch with the master, the master will receive all the code changes you made in the test branch, However, if you make changes to the master branch and your test branch, then the changes from the test branch will be merged into the master branch, but the test branch will not have the changes you made in the master branch.

Thanks.

Is there any command to run to make a previously used branch similar to master branch again? Or is -D and create again the easy answer?

Re: Git branches

I believe you can do 'git pull path/to/master' or something like that.

http://b.lesseverything.com/2008/3/25/g … and-github has a little bit better explanation of how git works compared to svn if you want to take a look at that as well.

Re: Git branches

I guess 'git rebase' will do it.

Re: Git branches

Ah! That's good to know! Thanks