快进合并我分支的根到我的分支
fast-forward merge the root of my branch into my branch
几天前,我从 master
分支了 feature
并砍掉了,将我的提交放入 feature
。 master
(和 origin/master)从未移动过,所以,如果我在 master
,我可以快进到 feature
。但我在 feature
。显然,签出 master
并将其合并到 feature
并不难,但是有没有一种方法可以在 on 时将父分支快速转发到我的工作分支] 我的工作分支?
发件人:
|--|--| << master
\
\
|--|--| << feature (checked out)
^
HEAD
git magic-command
|--|--|
\
\
|--|--| << master (checked out), feature
^
HEAD
只是尝试 git merge master
returns 'Already up-to-date' 和 rebase 没有意义,因为重播该作品会让我处于完全相同的状态。我想我可以 git reset master
之类的,但这似乎很老套。
要回答这个问题,不 - 除非你想使用 rebase
并在你和你的合作伙伴之间激起很多恶意*。
听起来您可以从受 Vincent Driessen 启发的 git flow
tool though. It uses the Git Flow 中获益,并围绕它创建一组不错的命令。
*:我说 "ill will" 因为 perils of rebasing。你正在重写历史,如果有人依赖被错误的 rebase 重写的历史,他们现在必须花时间和精力来恢复他们的工作状态,以便他们可以继续工作。 far 简单地进行合并甚至使用 Git Flow 就像我上面描述的那样。
如果您指定-f
,您可以使用git branch
强制更新日期
-f
--force
Reset <branchname> to <startpoint> if <branchname> exists already. Without -f git branch refuses to change an existing branch.
请注意 Git 将更新您的分支,即使它不是快进合并。如果您想要一种安全措施,您可能需要编写一些调用 git merge-base --is-ancestor
的脚本来验证您在执行更新之前处于快进状态。
几天前,我从 master
分支了 feature
并砍掉了,将我的提交放入 feature
。 master
(和 origin/master)从未移动过,所以,如果我在 master
,我可以快进到 feature
。但我在 feature
。显然,签出 master
并将其合并到 feature
并不难,但是有没有一种方法可以在 on 时将父分支快速转发到我的工作分支] 我的工作分支?
发件人:
|--|--| << master
\
\
|--|--| << feature (checked out)
^
HEAD
git magic-command
|--|--|
\
\
|--|--| << master (checked out), feature
^
HEAD
只是尝试 git merge master
returns 'Already up-to-date' 和 rebase 没有意义,因为重播该作品会让我处于完全相同的状态。我想我可以 git reset master
之类的,但这似乎很老套。
要回答这个问题,不 - 除非你想使用 rebase
并在你和你的合作伙伴之间激起很多恶意*。
听起来您可以从受 Vincent Driessen 启发的 git flow
tool though. It uses the Git Flow 中获益,并围绕它创建一组不错的命令。
*:我说 "ill will" 因为 perils of rebasing。你正在重写历史,如果有人依赖被错误的 rebase 重写的历史,他们现在必须花时间和精力来恢复他们的工作状态,以便他们可以继续工作。 far 简单地进行合并甚至使用 Git Flow 就像我上面描述的那样。
如果您指定-f
git branch
强制更新日期
-f
--force
Reset <branchname> to <startpoint> if <branchname> exists already. Without -f git branch refuses to change an existing branch.
请注意 Git 将更新您的分支,即使它不是快进合并。如果您想要一种安全措施,您可能需要编写一些调用 git merge-base --is-ancestor
的脚本来验证您在执行更新之前处于快进状态。