国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

【Git】Git pull代碼時(shí),出現(xiàn)報(bào)錯(cuò):hint: you have divergent branches and need to specify how to reconcile them.

這篇具有很好參考價(jià)值的文章主要介紹了【Git】Git pull代碼時(shí),出現(xiàn)報(bào)錯(cuò):hint: you have divergent branches and need to specify how to reconcile them.。希望對大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

問題描述

在執(zhí)行 git pull 時(shí),出現(xiàn)了如下提示:

?  git:(test) git pull origin develop
 * branch              develop       -> FETCH_HEAD
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint: 
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint: 
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches.

原因分析:

先翻譯下提示的信息:
git:(develop) git pull origin develop
提示:您有不同的分支,需要指定如何協(xié)調(diào)它們。
提示:您可以通過在之前某個(gè)時(shí)間運(yùn)行以下命令之一來做到這一點(diǎn)
提示:你的下一次獲取:
提示:
提示:git config pull.rebase false # 合并(默認(rèn)策略)
提示:git config pull.rebase true # Rebase
提示:git config pull.ff only # 僅快進(jìn)
提示:
提示:可以將“git config”替換為“git config——global”來設(shè)置默認(rèn)值
提示:首選所有存儲庫。你也可以傳遞——rebase,——no-rebase,
提示:或命令行上的——ff-only,以覆蓋配置的默認(rèn)per
提示:調(diào)用。
fatal:需要指定如何協(xié)調(diào)不同的分支。

原因:因?yàn)槟阍?code>pull代碼之前,進(jìn)行了merge并更新代碼的操作,而其他人在你之前提交了一個(gè)版本,導(dǎo)致版本不一致。文章來源地址http://www.zghlxwxcb.cn/news/detail-851090.html


解決方案:

  • 方案一:
    • 按照提示,直接執(zhí)行git config pull.rebase false
    • 該操作是默認(rèn)獲取最新代碼,并與本地合并,如果有沖突,需要解決沖突。
  • 方案二:
    • 該方法適用于兩個(gè)分支的合并
    • 先保存下修改內(nèi)容,然后將當(dāng)前分支回退到修改代碼之前的版本,執(zhí)行pull以獲取最新代碼
    • 然后將要合并的分支合并到當(dāng)前分支,再將自己的改動添加上,
    • 最后再提交代碼

到了這里,關(guān)于【Git】Git pull代碼時(shí),出現(xiàn)報(bào)錯(cuò):hint: you have divergent branches and need to specify how to reconcile them.的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包