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

196 Views Asked by At

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

There are 1 best solutions below

4
VonC On BEST ANSWER

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.

sync

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:

https://miro.medium.com/v2/resize:fit:1100/format:webp/1*fEymXmfqPwsolwGuGFvMIQ.png