git 解决主库冲突conflict
来源:互联网 发布:股票盈亏软件 编辑:程序博客网 时间:2024/06/04 18:45
首先查看远程分支:
yishiyaonie:ts-admin liuhanlin$ git remote showoriginqbox
如果缺少远程分支,可以添加远程分支
git remote add qbox https://github.com/qbox/ts-admin.git
其次需要查看分支情况:
yishiyaonie:ts-admin liuhanlin$ git remote show qbox* remote qbox Fetch URL: https://github.com/qbox/ts-admin.git Push URL: https://github.com/qbox/ts-admin.git HEAD branch: master Remote branch: master tracked Local ref configured for 'git push': master pushes to master (local out of date)yishiyaonie:ts-admin liuhanlin$ git remote show origin* remote origin Fetch URL: https://github.com/jiaojunjiahanlin/ts-admin.git Push URL: https://github.com/jiaojunjiahanlin/ts-admin.git HEAD branch: master Remote branch: master tracked Local branch configured for 'git pull': master merges with remote master Local ref configured for 'git push': master pushes to master (up to date)
然后fetch
yishiyaonie:ts-admin liuhanlin$ git fetch qboxyishiyaonie:ts-admin liuhanlin$ git merge qbox/masterAuto-merging src/aone.qiniu.com/app/main.goCONFLICT (content): Merge conflict in src/aone.qiniu.com/app/main.goAutomatic merge failed; fix conflicts and then commit the result.
产生冲突confilict的原因是因为不同的人修改了主库相同地方的代码。需要确定以谁的为准。或者都保留。
yishiyaonie:ts-admin liuhanlin$ vim src/aone.qiniu.com/app/main.go
yishiyaonie:ts-admin liuhanlin$ git statusOn branch masterYour branch is up-to-date with 'origin/master'.You have unmerged paths. (fix conflicts and run "git commit")Changes to be committed: new file: src/aone.qiniu.com/app/controllers/token.go modified: website/src/app/manage.html new file: website/src/app/services/tsutilcheck.coffee new file: website/src/app/tsutil/checkbase64.coffee new file: website/src/app/tsutil/checkbase64.html new file: website/src/app/tsutil/checkip.coffee new file: website/src/app/tsutil/checkip.html new file: website/src/app/tsutil/checktoken.coffee new file: website/src/app/tsutil/checktoken.html new file: website/src/app/tsutil/index.html new file: website/src/app/tsutil/layout.htmlUnmerged paths: (use "git add <file>..." to mark resolution) both modified: src/aone.qiniu.com/app/main.goChanges not staged for commit: (use "git add/rm <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) deleted: aone.dockerfile deleted: build_aone.shyishiyaonie:ts-admin liuhanlin$ git add .yishiyaonie:ts-admin liuhanlin$ git statusOn branch masterYour branch is up-to-date with 'origin/master'.All conflicts fixed but you are still merging. (use "git commit" to conclude merge)Changes to be committed: deleted: aone.dockerfile deleted: build_aone.sh new file: src/aone.qiniu.com/app/controllers/token.go modified: src/aone.qiniu.com/app/main.go modified: website/src/app/manage.html new file: website/src/app/services/tsutilcheck.coffee new file: website/src/app/tsutil/checkbase64.coffee new file: website/src/app/tsutil/checkbase64.html new file: website/src/app/tsutil/checkip.coffee new file: website/src/app/tsutil/checkip.html new file: website/src/app/tsutil/checktoken.coffee new file: website/src/app/tsutil/checktoken.html new file: website/src/app/tsutil/index.html new file: website/src/app/tsutil/layout.htmlyishiyaonie:ts-admin liuhanlin$ git commit -m 'resolve conflict'[master 4c4f381] resolve conflict Committer: LiuHanlin <liuhanlin@yishiyaonie.local>Your name and email address were configured automatically basedon your username and hostname. Please check that they are accurate.You can suppress this message by setting them explicitly. Run thefollowing command and follow the instructions in your editor to edityour configuration file: git config --global --editAfter doing this, you may fix the identity used for this commit with: git commit --amend --reset-authoryishiyaonie:ts-admin liuhanlin$ git statusOn branch masterYour branch is ahead of 'origin/master' by 7 commits. (use "git push" to publish your local commits)nothing to commit, working directory cleanyishiyaonie:ts-admin liuhanlin$ git push originCounting objects: 38, done.Delta compression using up to 4 threads.Compressing objects: 100% (34/34), done.Writing objects: 100% (38/38), 6.74 KiB | 0 bytes/s, done.Total 38 (delta 18), reused 20 (delta 4)To https://github.com/jiaojunjiahanlin/ts-admin.git a6aef3f..4c4f381 master -> master
1 0
- git 解决主库冲突conflict
- Git使用之——冲突解决一(git merge conflict)
- Git使用之——冲突解决一(git merge conflict)
- 使用git cherry-pick 解决冲突,commit changes to other branch and resolve conflict
- git---分支合并冲突处理(conflict)
- maven 解决依赖冲突 omiit for conflict
- 解决Xcode8之后代码有冲突时自带git工具不出来解决conflict的面板的问题
- 【转】解决 Git 的 Merge Conflict
- 命令行内解决git rebase conflict
- Git冲突和解决冲突
- Git Conflict
- git 冲突解决
- git 冲突的解决
- git 解决冲突问题
- Git pull 冲突解决
- GIT 4 冲突解决
- git的冲突解决
- Git下冲突解决
- C语言实现服务端和客户端进行TCP通信实例
- [Python] ValueError: unknown locale: UTF-8
- &&
- C++中类的前置声明
- 根据经纬度获取当前地址
- git 解决主库冲突conflict
- 接口
- 【语言-C++】 Clipboard(剪贴板)2-监听剪贴板并直接显示剪贴板内容到窗口
- 在cmd下运行monkeyrunner时报错Script terminated due to an exception
- 2016 Multi-University Training Contest 3 1010 Teacher Bo(数学)
- html5语义化标签
- caffe学习(一):CIFAR-10
- IT-linux-linux故障排错
- Manacher 算法模板