亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

directory search
Guides gitattributes giteveryday gitglossary gitignore gitmodules gitrevisions gittutorial gitworkflows Administration git archive git bundle git clean git filter-branch git fsck git gc git instaweb git reflog Basic Snapshotting git add git commit git diff git mv git reset git rm git status Branching and Merging git branch git checkout git log git merge git mergetool git stash git tag Debugging git bisect git blame git grep Email git am git format-patch git request-pull git send-email External Systems git fast-import git svn Getting and Creating Projects git clone git init Git git annotate git archimport git bisect-lk2009 git check-attr git check-mailmap git check-ref-format git checkout-index git cherry git citool git column git credential git credential-cache git credential-store git cvsexportcommit git cvsimport git cvsserver git diff-files git diff-tree git difftool git fast-export git fetch-pack git fmt-merge-msg git get-tar-commit-id git gui git http-backend git http-fetch git http-push git imap-send git index-pack git interpret-trailers git ls-remote git ls-tree git mailinfo git mailsplit git merge-file git merge-index git merge-one-file git merge-tree git mktag git mktree git name-rev git notes git p4 git pack-objects git pack-redundant git pack-refs git parse-remote git patch-id git prune git prune-packed git quiltimport git receive-pack git remote-ext git remote-fd git remote-testgit git repack git replace git rerere git send-pack git sh-i18n git sh-setup git shell git show-branch git show-index git stripspace git unpack-file git unpack-objects git upload-archive git upload-pack git var git verify-commit git verify-tag git whatchanged git worktree Inspection and Comparison git describe git shortlog git show Miscellaneous api credentials api index gitcli gitcore tutorial gitcredentials gitcvs migration gitdiffcore githooks gitk gitnamespaces gitremote helpers gitrepository layout gitsubmodules gittutorial 2 gitweb gitweb.conf pack format User Manual Patching git apply git cherry-pick git rebase git revert Plumbing Commands git cat-file git check-ignore git commit-tree git count-objects git diff-index git for-each-ref git hash-object git ls-files git merge-base git read-tree git rev-list git rev-parse git show-ref git symbolic-ref git update-index git update-ref git verify-pack git write-tree Server Admin git daemon git update-server-info Setup and Config git git config git help Sharing and Updating Projects git fetch git pull git push git remote git submodule
characters

名稱

git-rerere  - 重復(fù)使用沖突合并的記錄分辨率

概要

git rerere [clear|forget <pathspec>|diff|remaining|status|gc]

描述

在采用相對(duì)較長(zhǎng)時(shí)間的主題分支的工作流中,開發(fā)人員有時(shí)需要一遍又一遍地解決相同的沖突,直到主題分支完成(合并到“release”分支,或發(fā)送并接受上游)。

此命令通過在初始手動(dòng)合并時(shí)記錄沖突的自動(dòng)合并結(jié)果和相應(yīng)的手動(dòng)分析結(jié)果,并將先前記錄的手動(dòng)分辨率應(yīng)用于其相應(yīng)的自動(dòng)合并結(jié)果,來(lái)幫助開發(fā)人員處理此過程。

注意

您需要設(shè)置配置變量rerere.enabled才能啟用此命令。

命令

通常,git rerere運(yùn)行時(shí)沒有參數(shù)或用戶干預(yù)。但是,它有幾個(gè)允許它與其工作狀態(tài)交互的命令。

clear

如果要中止合并分辨率,請(qǐng)重置rerere使用的元數(shù)據(jù)。調(diào)用git am [--skip|--abort]git rebase [--skip|--abort]將自動(dòng)調(diào)用此命令。

forget <pathspec>

在<pathspec>中重置針對(duì)當(dāng)前沖突記錄的沖突解決方案。

diff

顯示分辨率當(dāng)前狀態(tài)的差異。跟蹤用戶解決沖突時(shí)更改的內(nèi)容很有用。其他參數(shù)直接傳遞給diff安裝在PATH中的系統(tǒng)命令。

status

具有合并分辨率將會(huì)記錄的沖突的打印路徑。

remaining

打印具有尚未由rerere自動(dòng)解決的沖突的路徑。這包括其分辨率無(wú)法通過rerere進(jìn)行跟蹤的路徑,例如沖突的子模塊。

gc

Prune記錄很久以前發(fā)生的沖突合并。默認(rèn)情況下,將修剪超過15天的未解決的沖突并修復(fù)60天以上的已解決沖突。這些默認(rèn)值分別通過gc.rerereUnresolvedgc.rerereResolved配置變量進(jìn)行控制。

討論

當(dāng)您的主題分支修改主分支(或上游)在主題分支從其分支后觸及的重疊區(qū)域時(shí),即使在主題分支已準(zhǔn)備好向上游推送之前,也可能需要使用最新的主分支進(jìn)行測(cè)試:

              o---*---o topic             /
    o---o---o---*---o---o master

對(duì)于這樣的測(cè)試,您需要以某種方式合并主題和主題。一種方法是將主人拉入主題分支:

        $ git checkout topic
        $ git merge master

              o---*---o---+ topic             /           /
    o---o---o---*---o---o master

標(biāo)記的提交*觸摸同一文件中的同一區(qū)域; 您需要在創(chuàng)建標(biāo)記為的提交時(shí)解決沖突+。然后,您可以測(cè)試結(jié)果,以確保您的工作進(jìn)行中仍然適用于最新的master。

在這次測(cè)試合并之后,有兩種方法可以繼續(xù)您關(guān)于該主題的工作。最簡(jiǎn)單的方法是在測(cè)試合并提交的基礎(chǔ)上構(gòu)建+,當(dāng)主題分支中的工作終于準(zhǔn)備就緒后,將主題分支拉入主內(nèi)容中,和/或請(qǐng)求上游從您那里撤出。然而到那時(shí),主測(cè)試或上游測(cè)試合并后可能已經(jīng)進(jìn)階+,在這種情況下,最終提交圖如下所示:

        $ git checkout topic
        $ git merge master
        $ ... work on both topic and master branches
        $ git checkout master
        $ git merge topic

              o---*---o---+---o---o topic             /           /         \
    o---o---o---*---o---o---o---o---+ master

然而,當(dāng)你的主題分支是長(zhǎng)期存在的時(shí)候,你的主題分支最終會(huì)有很多這樣的“Merge from master”提交,這會(huì)不必要地混淆發(fā)展歷史。Linux內(nèi)核郵件列表的讀者可能還記得,當(dāng)一個(gè)子系統(tǒng)維護(hù)者要求從一個(gè)充滿“useless merges”的分支中拉出時(shí),Linus抱怨這種頻繁的測(cè)試合并。

作為替代方案,為了保持主題分支不受測(cè)試合并的干擾,您可以放棄測(cè)試合并,并在測(cè)試合并之前繼續(xù)構(gòu)建在提示之上:

        $ git checkout topic
        $ git merge master
        $ git reset --hard HEAD^ ;# rewind the test merge
        $ ... work on both topic and master branches
        $ git checkout master
        $ git merge topic

              o---*---o-------o---o topic             /                     \
    o---o---o---*---o---o---o---o---+ master

當(dāng)您的主題分支最終準(zhǔn)備就緒并合并到主分支時(shí),這將只剩下一個(gè)合并提交。此合并將要求您解決標(biāo)記為的提交引入的沖突*。但是,這種沖突通常與您在創(chuàng)建測(cè)試合并時(shí)所解決的沖突相同。git rerere使用您早先解決的問題中的信息幫助您解決最終沖突的合并問題。

運(yùn)行git rerere一個(gè)沖突automerge后,立即命令記錄沖突工作樹中的文件,與通常的沖突標(biāo)志<<<<<<<,=======以及>>>>>>>在其中。稍后,在解決沖突之后,git rerere再次運(yùn)行將記錄這些文件的已解決狀態(tài)。假設(shè)您在創(chuàng)建主控測(cè)試合并到主題分支時(shí)執(zhí)行了此操作。

下一次,在看到相同的沖突automerge之后,運(yùn)行git rerere將執(zhí)行早先沖突的automerge,早期的手動(dòng)分辨率和當(dāng)前沖突的automerge之間的三方合并。如果這個(gè)三路合并干凈地解決,結(jié)果寫出到您的工作樹文件,因此您不必手動(dòng)解決它。請(qǐng)注意,git rerere單獨(dú)保留索引文件,因此您仍然需要使用git diff(或git diff -c)進(jìn)行最終的完整性檢查,并且git add當(dāng)您滿意時(shí)。

作為一種便利措施,git merge自動(dòng)調(diào)用git rerere退出時(shí)失敗的自動(dòng)合并,git rerere并在新的沖突時(shí)記錄手的解決方案,或者在不是時(shí)重新使用先前的手解決方案。在提交合并結(jié)果時(shí)git commit也會(huì)調(diào)用git rerere。這意味著你不需要做任何特別的事情(除了啟用rerere.enabled配置變量)。

在我們的示例中,當(dāng)您進(jìn)行測(cè)試合并時(shí),手動(dòng)解析會(huì)被記錄下來(lái),并且只要記錄的分辨率仍然適用,稍后使用更新的主控和主題分支進(jìn)行實(shí)際合并時(shí),它將被重用。

信息git rerere記錄也在運(yùn)行時(shí)使用git rebase。在主題分支上淘汰測(cè)試合并并繼續(xù)開發(fā)之后:

              o---*---o-------o---o topic             /
    o---o---o---*---o---o---o---o   master

        $ git rebase master topic

                                  o---*---o-------o---o topic                                 /
    o---o---o---*---o---o---o---o   master

您可以運(yùn)行git rebase master topic,在您的主題準(zhǔn)備好向上游發(fā)送之前讓自己保持最新狀態(tài)。這會(huì)導(dǎo)致回退到三路合并,并且與您之前解決的測(cè)試合并相同。git rerere將通過運(yùn)行git rebase來(lái)幫助你解決這個(gè)沖突。

Previous article: Next article: