//创建本地分支 制造冲突Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2$ git clone git@github.com:ZhuBaker/learngit.git .Cloning into '.'...remote: Counting objects: 32, done.remote: Compressing objects: 100% (20/20), done.remote: Total 32 (delta 3), reused 30 (delta 1), pack-reused 0Receiving objects: 100% (32/32), done.Resolving deltas: 100% (3/3), done.Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master)$ git checkout -b featureSwitched to a new branch 'feature'Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (feature)$ lsabc.txt dd ddd.txt READMYFILEAdministrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (feature)$ vim READMYFILEAdministrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (feature)$ git add READMYFILEAdministrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (feature)$ git commit -m 'feature'[feature 62feb86] feature 1 file changed, 1 insertion(+)//切换到 master分支Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (feature)$ git checkout masterSwitched to branch 'master'Your branch is up-to-date with 'origin/master'.Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master)$ vim READMYFILEAdministrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master)$ git add READMYFILEAdministrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master)$ git commit -m 'master'[master a1d0ee6] master 1 file changed, 1 insertion(+)//开始合并代码Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master)$ git merge featureAuto-merging READMYFILECONFLICT (content): Merge conflict in READMYFILEAutomatic merge failed; fix conflicts and then commit the result.Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master|MERGING)$ git statusOn branch masterYour branch is ahead of 'origin/master' by 1 commit. (use "git push" to publish your local commits)You have unmerged paths. (fix conflicts and run "git commit") (use "git merge --abort" to abort the merge)Unmerged paths: (use "git add..." to mark resolution) both modified: READMYFILEno changes added to commit (use "git add" and/or "git commit -a")Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master|MERGING)$ cat READMYFILEadd by masterfeature<<<<<<< HEADFFFF=======DDDD>>>>>>> featureAdministrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master|MERGING)$ vim READMYFILEAdministrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master|MERGING)$ git add READMYFILEAdministrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master|MERGING)$ git commit -m 'merge'[master d2ac9a9] merge//测试已经合并成功Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master)$ git merge featureAlready up-to-date.Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master)$ git pushCounting objects: 9, done.Delta compression using up to 4 threads.Compressing objects: 100% (6/6), done.Writing objects: 100% (9/9), 926 bytes | 0 bytes/s, done.Total 9 (delta 0), reused 0 (delta 0)To github.com:ZhuBaker/learngit.git 2360738..d2ac9a9 master -> master//删除本地临时分支Administrator@EZ-20170513RQHH MINGW32 /d/workspace/learngit/learn2 (master)$ git branch -d featureDeleted branch feature (was 62feb86).