show branches list
create new brancj
change branch
merge branch
git merge targetBranchName
if it is comfilct
- master branch
- commit 1
- commit 2
- commit fromMasterBran
- test branch
- commit 1
- commit 2
- commit fromTestBran
they all change hello.txt in third commit change, how to deal with when you are trying git merge testBranch?
it will fail merge, and change you hello.txt in working dir.
<<<<<<< HEAD
bbbbb
=======
aaaa
>>>>>>> testBran
you have to add a commit to master branch till this comfilct is not exist.
- master branch
- commit 1
- commit 2
- commit fromMasterBran
- commit checkout conflict
then git merge testBran
- master branch
- commit 1
- commit 2
- commit fromMasterBran
- commit fromTestBran
- commit checkout conflict
- test branch
- commit 1
- commit 2
- commit fromTestBran
git only saves changes, do not let them conflict before merge them.
- commit fromMasterBran mean
add changes to hello.txt compare to commit 2
- commit fromTestBran mean
add changes to hello.txt compare to commit 2
- commit checkout conflict mean
figure conflict to above two compare to commit 2
It's fine!
delete branch
normal delete
force delete
show branches list
create new brancj
change branch
merge branch
if it is comfilct
they all change hello.txt in third commit change, how to deal with when you are trying
git merge testBranch?it will fail merge, and change you hello.txt in working dir.
you have to add a commit to master branch till this comfilct is not exist.
then
git merge testBrangit only saves changes, do not let them conflict before merge them.
add changes to hello.txtcompare to commit 2add changes to hello.txtcompare to commit 2figure conflict to above twocompare to commit 2It's fine!
delete branch
normal delete
force delete