Git - 自动快速转发所有追踪分支 [英] Git - Automatically fast forward all tracking branches on pull
问题描述
我用 - track
选项设置了跟踪分支,当我做一个 git pull
在 master
上,它会将所有分支提取到 origin / branchname
,但不会与本地跟踪分支合并。这很烦人,因为如果我稍后在 master
上执行 git push
,则表示非快进更新在跟踪分支上被拒绝,因为它们并未在最初的 git pull
中快速转发。
我的问题是:如何使 git pull
获取所有分支并自动快速转发所有跟踪分支?
注意: git pull
用于使用我的GitHub回购站快速转发所有跟踪分支,但现在我我已经使用Gitolite设置了自己的回购站,这个问题正在出现。
- git不会合并(
git pull
在fetch
部分)文件,除非首先检出分支。请参阅能混帐拉 - 所有
更新我所有的本地分支机构? $ <$ c $> - 当设置为
false
时,这个变量告诉Git创建一个额外的合并提交在这种情况下(相当于从命令行提供- no-ff
选项)。 - 仅设置为
时,只允许进行这样的快进合并(相当于给出
- ff-only
选项)。 - git won't merge (the second step of
git pull
after thefetch
part) files unless the branch is checked out first. See "Can "git pull --all
" update all my local branches?" git pull
onmaster
will merge files onmaster
, meaning the next push will be a fast-forward one. A non fast-forward can only occur if a push to the remotemaster
from another repo has been done prior to your push.- When set to
false
, this variable tells Git to create an extra merge commit in such a case (equivalent to giving the--no-ff
option from the command line). - When set to
only
, only such fast-forward merges are allowed (equivalent to giving the--ff-only
option from the command line).
git pull
on master
会将 master
中的文件合并,这意味着下一次推送将是一个快进的文件。非快进,则仅可推出现在 推送之前完成了远程 master
来自另一个回购。 注意:我想你已经跟踪了所有的远程分支,如跟踪所有远程git分支作为本地分支。
'p>请注意:GIT中2.0(Q2 2014)将与提交b814da8 一> a config push.ff:
pull.ff ::
默认情况下,Git在合并作为当前提交的后代的提交时不会创建额外的合并提交。相反,当前分支的尖端被快速转发。
I've set up tracking branches with the --track
option, and when I do a git pull
on master
, it fetches all branches to origin/branchname
but doesn't merge with the local tracking branches. This is extra annoying, because if I later do a git push
on master
, it says that non-fast-forward updates were rejected on the tracking branches, since they weren't fast-forwarded on the initial git pull
.
My question is: How do I make it so that git pull
with fetch all branches and automatically fast-forward all the tracking branches?
Note: git pull
used to fast-forward all my tracking branches with my GitHub repos, but now that I've set up my own repos using Gitolite, this problem is cropping up.
But wait:
Note: I suppose you have tracked all your remote branches as in "Track all remote git branches as local branches."
Note: Git 2.0 (Q2 2014) will introduce with commit b814da8 a config push.ff:
pull.ff::
By default, Git does not create an extra merge commit when merging a commit that is a descendant of the current commit. Instead, the tip of the current branch is fast-forwarded.
这篇关于Git - 自动快速转发所有追踪分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!