編譯器配置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哈

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章