Assume that I've got a project with two branches. One is master and the other is dev. I'm using git and do either of the following:
git checkout master
git merge dev
git checkout dev
git merge master
My question: What is the difference of case 1 and case 2?
git checkout master
git merge dev
Will checkout the 'master' branch and merge from the 'dev' branch. Any applicable changes within 'dev' will be in 'master' once this command has completed.
git checkout dev
git merge master
Will checkout the 'dev' branch and merge from the 'master' branch. Any applicable changes within 'master' will be in 'dev' once this command has completed.
For more information, take a look at Basic Branching and Merging.
in the first case, the changes made in dev are merged to master (leaving dev unaffected)....whereas in the second case, the changes made in master (leaving master unaffected) are merged to dev. Please check this link for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With