编译器配置git更新类型update type 的选择

一、git type的选择

一共有三种选择,在配置编译器的时候,会提示我们作出选择:如下
在这里插入图片描述

  1. merge 合并
  2. Rebase 保留本地项目代码
  3. Branch Default 保留远程仓库的代码

二、区别

这三者如果没有冲突,update的表现方式是没有区别的,但是如果需要更新的文件和远程仓库有差异,就会有不同的表现

2.1 merge

select this option to perform merge during the update. This is equivalent to running git fetch and then git merge, or git pull --no-rebase.

采用合并的方式来更新代码,此时会产生一个commit,这也是一般常用的默认的操作,这个的好处是能够在log中看到所有的操作记录,但是对于代码洁癖来说,可能会无法接受。

2.2 Rebase

select this option to perform rebase during the update. This is equivalent to running git fetch and then git rebase, or git pull --rebase (all local commits will be put on top of the updated upstream head).

简单来说就是所有的本地commit都是默认放到远程的commit记录的顶部,log也只会有一条记录线,简洁,但是有时候排查问题会不方便。

2.3 Branch Defalut

select this option if you want to apply different update strategies for different branches. You can specify the default update type for each branch in the branch. section of the .git/config configuration file.

这个意思是,每个分支都可以设置自己的update方式,可以在config中设置,这个是选择分支默认的方式

三、后记

根据代码习惯和熟练度来使用,一般常用的是merge。
最后右侧默认选择 using stash哈

扫描二维码关注公众号,回复: 9714568 查看本文章
发布了60 篇原创文章 · 获赞 66 · 访问量 6万+

猜你喜欢

转载自blog.csdn.net/u012436704/article/details/101167399
今日推荐