git 产生冲突的处理方式

理解你操作图形化的时候, git 在什么?
了解你在做的文件的git状态?
1. 添加文件
git add . -A
git commit -m "your commit here"
git fetch
git pull -- 产生merge
git push
2. 合并

合并的机制

递归三路合并
HEAD, target, target-before

合并中

无冲突, "丢弃文件", git无记录

有冲突, 有修改, git 有记录

处理冲突

git pull
-- fix conflict


git merge --continue
git merge --abort

merge中的文件,除非冲突文件,谨慎修改

关键点:

3. 选择某一个提交
git cherry-pick [commit-hash]


git cherry-pick --continue
git cherry-pick --abort
4. 回档
git reset [--hard|--soft|--mixed]
git revert [commit-hash]
5. 更多

查看merge中的变更 link

查看 sourctree 对应的命令 link

查看 => 显示命令历史

git reset xx

git chekcout -- xx

  1. 其他(干货) 插件推荐 restClient 快速定位 Edit History Bookmarks
posted @ 2022-12-19 17:30  明媚下雨天  阅读(250)  评论(0)    收藏  举报