【问题标题】:Make git pull (rebase) by default pull only from current downstream branchgit pull (rebase) 默认只从当前下游分支拉取
【发布时间】:2012-07-11 17:18:19
【问题描述】:

我正在使用我在做 git pull 时找到pull --rebase by default 的方法:

现在我想做'git pull' - 默认情况下只拉当前分支:How do you get git to always pull from a specific branch?。但是,当 git 默认配置为 rebase 时,此答案不起作用。

有没有办法让 git pull 总是变基并只拉当前分支?

【问题讨论】:

标签: git


【解决方案1】:

考虑到this answer 提及:

如果你有branch.autosetuprebase = always,那么它也会添加:

rebase = true

你可以在git branch --set-upstream master origin/master之后,配置你的分支的rebase属性:

git config branch.master.rebase false

【讨论】:

  • 啊,我没看到。谢谢!
  • 我为什么要做“git config branch.master.rebase false”?这会将 .git/config 中的 rebase 标志设置为 false
  • @mbdev 在git pull之后默认避免git变基。
  • 哦,我们有一个 rebase 政策,所以我希望它 --rebase git pull
  • @mbdev 在这种情况下,git branch --set-upstream master origin/master 就足够了:来自您的分支的任何git pull 仍将获取上游分支。 (然后在它上面重新设置你的分支)
猜你喜欢
  • 2015-05-26
  • 2016-05-03
  • 1970-01-01
  • 1970-01-01
  • 2011-08-28
  • 2023-01-14
  • 2019-10-27
  • 2021-11-17
  • 2017-12-07
相关资源
最近更新 更多