为什么我的VS Code的git指示器在分支名旁边显示”(Rebasing)”?

huangapple go评论72阅读模式
英文:

Why is my VS Code's git indicator showing "(Rebasing)" next to the branch name?

问题

我在我的vscode中遇到了一个关于git配置的问题。我相信git pull默认设置为执行合并操作。几周前,我运行了git config pull.rebase true,从那时起,我一直看到我的分支名称旁边显示着"(Rebasing)"。如下图所示:

为什么我的VS Code的git指示器在分支名旁边显示”(Rebasing)”?

我尝试将其恢复为默认的git config,使用命令git config pull.rebase false,但根本没有起作用。

为什么会发生这种情况(是有什么问题吗?),我该如何将其恢复为正常状态?

英文:

I'm having an issue with my vscode for git config. I believe git pull is set to perform merges by default. A couple weeks ago, I ran git config pull.rebase true, and since then, I keep seeing "(Rebasing)" next to my branch name. Like below:

为什么我的VS Code的git指示器在分支名旁边显示”(Rebasing)”?

I tried to revert it to default git config with git config pull.rebase false, but it's not working at all.

Why is this happening (is something wrong?), and how can I get it back to normal?

答案1

得分: 2

听起来你开始了一个变基操作,但没有完成。如果你正在进行变基并想中止它,请使用 git rebase --abort。否则,你应该能够在源代码控制视图中看到仍然需要解决冲突的文件,它们旁边会有一个 "UU" 指示器。然后你可以找到它们,修复它们,然后运行 git rebase --continue

英文:

It sounds like you started a rebase and didn't finish. If you're in the middle of a rebase and want to abort it, use git rebase --abort. Otherwise, you should be able to see files that still need conflicts resolved in the Source Control view with a "UU" indicator next to them. Then you can find them, fix them, and run git rebase --continue.

答案2

得分: -1

为了防止 pull 尝试自动合并,请运行以下命令来更新全局 git 配置:

git config --global pull.ff only

这可能会导致 pull 失败,特别是在共享分支上,但在那时很容易进行 rebasepull -r

我也会关闭自动 rebase 功能:

git config --global pull.rebase false

这两个设置会使 git 在分支历史分歧时表现得更加可预测。

英文:

To prevent pull from attempting to auto-merge, run the following command to update your global git config:

git config --global pull.ff only

This may result in a failed pull especially on a shared branch, but it's easy enough to do a rebase at that point or a pull -r.

I would also turn off the auto-rebase feature:

git config --global pull.rebase false

Both these things will cause git to act more predictably when there's divergent branch history.

huangapple
  • 本文由 发表于 2023年2月14日 02:50:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/75440076.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定