草庐IT

rebase-apply

全部标签

git - rebase 树(提交/分支及其所有子节点)

这个问题在这里已经有了答案:Rebasingabranchincludingallitschildren(5个答案)关闭4年前。这是我当前的git树:A-H(master)|\-B-C-D-E(feature)|\-F(new)|\-G(other)我想重新设置侧分支的基数,使其依赖于H而不是A:A-H(master)|\-B'-C'-D'-E'(feature)|\-F'(new)|\-G'(other)看似简单的概念,却很难自动完成。这个已经有人问了here和here,但建议的解决方案对我不起作用。首先,正如前文所指出的,当当前分支存在时,gitbranch输出的解析并不容易(有一

git - 允许在 git rebase 中 merge 不相关的历史

当你想rebase保持merge提交的分支时,你传递--preserve-merges标志。当您在git中merge不相关的历史记录时,您需要传递--allow-unrelated-histories标志。如果您在执行gitrebase--preserve-merges时,当现有merge来自不相关的历史记录时,它将失败:fatal:refusingtomergeunrelatedhistories如果你尝试gitrebase--preserve-merges--allow-unrelated-histories它失败了:error:unknownoption'allow-unrela

git - 为什么 Git 不问我就记住并使用来自中止的 rebase 的冲突解决方案?

我在我的分支上做了一个rebasefoogitrebasemaster做了一些冲突解决,然后决定我不想做,然后中止。gitrebase--abort所有的分支日志历史看起来都很正常。现在我想再次开始相同的过程。gitrebasemaster当git遇到它第一次遇到的第一个冲突时,它会像以前一样将文件列为冲突文件。但不是用标记冲突等等,它只是在我第一次解决冲突后显示文件的状态。有趣的是它有这个功能……但我实际上想以不同的方式解决其中一个冲突,所以我不希望它记住并重新应用。这里到底发生了什么,我可以将其关闭吗? 最佳答案 使用gitch

rebase 后 Git 分支已经 fork ,为什么要 rebase?

最近我收到通知说我的分支发生了分歧。那时我创建了一个功能分支,将其推送到远程,并在几天后再次开始工作时与master进行了rebase。gitcheckout-bfeature-branchgitpushoriginfeature-branch:feature-branch...当在master时...gitpulloriginmastergitcheckoutfeature-branchgitrebasemaster但是当我想再次推送我的分支时,它说:Onbranchfeature-branchYourbranchand'origin/feature-branch'havediver

git - 什么时候需要 git-rebase?

每次阅读git-rebase文档时,我都会迷失方向。在我看来,这就像一种低级操作(读作:黑魔法)。引用文档:Assumethefollowinghistoryexistsandthecurrentbranchis"topic":A---B---Ctopic/D---E---F---GmasterFromthispoint,theresultofeitherofthefollowingcommands:gitrebasemastergitrebasemastertopicwouldbe:A'--B'--C'topic/D---E---F---Gmaster问题是:为什么会有人想要做这样的

git - 为什么 'git stash apply' 会暂存我的更改?

我进行更改,然后我gitstash然后我gitstashapply我的问题是为什么在我gitstashapply之后,我的更改变成了“暂存”?也就是说,如果我执行gitdiff,我将看不到任何东西,如果我执行gitdiff--cached?,我只会看到我的不同之处是否可以“取消暂存”我通过gitstashapply命令暂存的更改?是否有任何git命令基本上可以让我“备份我的更改,将其重置到HEAD并将我的备份复制回来”?我认为gitstash然后gitstashapply是那个命令,但它是如何“暂存”我的所有更改的?是否有任何等效项可以让我gitstashapply而无需暂存我的更改部

git rebase 由于空格错误而失败

我正在尝试对一个分支进行rebase,但git正在pop,因为它正在尝试执行一些失败的merge操作。我如何让git停止它?#gitrebase-f--ontomaster~2master~masterFirst,rewindingheadtoreplayyourworkontopofit...Applying:r1002-CS1.0.23Usingindexinfotoreconstructabasetree...Mabout.html:68:trailingwhitespace.:115:trailingwhitespace.:201:trailingwhitespace.:236

git - 我如何 `git rebase -i` 并防止 "You asked to amend the most recent commit, but doing so would make it empty."?

我想运行一个gitrebase-isome-hash。当我运行它时,出现错误:Youaskedtoamendthemostrecentcommit,butdoingsowouldmakeitempty.Youcanrepeatyourcommandwith--allow-empty,oryoucanremovethecommitentirelywith"gitresetHEAD^".[...]Couldnotapply[...]该错误似乎特定于单个提交,因为--allow-empty不是我可以传递给rebase的选项。显然--keep-empty是我可以传递给gitrebase的选项,

Git rebase 出现 'unlink of file failed' 错误

使用msysgit1.7.0.2,在执行gitrebase-i时,挂起并且没有消息。输入ctrl+c后可以看到'unlinkoffilefailed,shouldItryagain(y/n)?'然后我尝试了gitrebase--abort但得到了同样的错误信息。所以现在它停留在rebase过程的中间。这个错误似乎是由只读文件引起的。有什么办法可以解决这个问题吗? 最佳答案 您尝试过setGIT_ASK_YESNO=false吗?这个Googlegroupthread在最近的mingwevolutions中提到了它:Makeuseof

algorithm - 与 git 中的 merge 相比,rebase 有什么优势?

在thisarticle,作者用这张图解释了rebase:Rebase:Ifyouhavenotyetpublishedyourbranch,orhaveclearlycommunicatedthatothersshouldnotbasetheirworkonit,youhaveanalternative.Youcanrebaseyourbranch,whereinsteadofmerging,yourcommitisreplacedbyanothercommitwithadifferentparent,andyourbranchismovedthere.虽然正常的merge看起来像这