1.我做了一個(gè)實(shí)驗(yàn),先commit,再pull,并且FETCH_HEAD不同的情況下。然后我用下面第一種pull的寫法,直接報(bào)錯(cuò),不給合并。而第二種是可以自動(dòng)merge的,只不過可能會(huì)有沖突。xxx:test_git horsen$ git pull origin developer:test1 From xxx ![rejected] developer -> test1 (non-fast-forward)xxx:test_git horsen$ git pull origin developer From xxxx * branch developer -> FETCH_HEAD Auto-merging ttt1.txt CONFLICT (content): Merge conflict in ttt1.txt Automaticmerge failed; fix conflicts and then commit the result.2.疑問第二種不就是省略了當(dāng)前分支嗎,講道理第一種寫法和第二種寫法不是等價(jià)的嗎為什么第二種可以merge,第二種直接rejected希望大佬解惑,謝謝
1 回答

牧羊人nacy
TA貢獻(xiàn)1862條經(jīng)驗(yàn) 獲得超7個(gè)贊
git pull其實(shí)就是git fetch + git merge
所以..請(qǐng)問你可以git merge origin developer:test1?
git merge命令是用于從指定的commit合并到當(dāng)前分支
的操作,注意是當(dāng)前分支,你是不能指定合并到其他分支到
- 1 回答
- 0 關(guān)注
- 1110 瀏覽
添加回答
舉報(bào)
0/150
提交
取消