使 vscode 的 git 集成在滞后于远程时取消推送(而不是自动合并)?

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

Make vscode's git integration cancel push if behind remote (instead of automerging)?

问题

我已经使用Atom的git集成很长时间了。现在它已经过时了,我切换到了VSCode,虽然与Atom相比,它的git集成不是很糟糕,至少是不同的。

其中一个不同之处是,当我落后于远程并想要推送时,当Atom的git集成意识到它落后时,它会中止并只执行获取操作(甚至不执行合并),并通知我,让我决定要做什么。相反,VSCode会在不向我询问任何问题的情况下执行合并,甚至将所有内容推送到远程,而不需要我的任何确认。

有没有办法禁用这个并采用Atom的方式?

英文:

I have been using Atom's git integration for a long time. Now that it's gone obsolete, I switched to vscode, whose git integration is if not terrible in comparison, at least different.

One of the differences is that when I'm behind the remote and want to push, when Atom's git integration realizes it's behind, it aborts and just does a fetch (not even a merge), informing me of it and letting me decide what to do. VSCode instead does a merge without asking me anything, and even pushes all that to the remote without any kind of confirmation from me.

Is there a way to disable this and do it atom-style ?

答案1

得分: 1

唯一一个会执行“自动合并,然后自动推送,即使我只要求简单推送”的VSCode操作是同步选项,如这里所解释的,它执行拉取(获取+合并),然后再次拉取。

使 vscode 的 git 集成在滞后于远程时取消推送(而不是自动合并)?

请确保您的Git 提交后命令 未设置为 syncpush,否则每次提交后都会执行拉取和/或推送!

您仍然可以通过三点菜单仅进行推送,如在VSCode中提交并推送更改到GitHub仓库的方法中所解释的,来自ZeroesAndOnes

使 vscode 的 git 集成在滞后于远程时取消推送(而不是自动合并)?

英文:

The only VSCode operation which would do "an automatic merge followed by an automatic puSH when I only asked for a simple push" is the sync option, which, as explained here, does a pull (fetch + merge), followed by a pull.

使 vscode 的 git 集成在滞后于远程时取消推送(而不是自动合并)?

Make sure your Git post-commit command is not set to sync or push, or you would experience a pull and/or push after each commit!

You can still do a push only through the three-dot menu, as explained in "How to commit and push your changes to your GitHub repository in VScode" from ZeroesAndOnes:

使 vscode 的 git 集成在滞后于远程时取消推送(而不是自动合并)?

huangapple
  • 本文由 发表于 2023年2月6日 13:55:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/75357773.html
匿名

发表评论

匿名网友

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

确定