Lately, for some reason, I've had to press this button every time I want to push a change to my GitHub repository:

I can't remember if there's a setting I've accidentally toggled.
I also never make changes to my repository outside my VS Code environment.
I'm using a Gatsby/GitHub/Netlify setup.
What's causing this button to appear every time? How do I get rid of it?
Update for June 2022 release of VS Code (1.69)
As mentioned in the release notes for VS Code June 2022 release (version 1.69) the button now has new actions https://code.visualstudio.com/updates/v1_69#_commit-action-button-for-git-repositories. The option to disable the button has changed, you can find the new options under the setting named 'Git: Show Action Button' or adjust them in your settings JSON, for example to hide all:
"git.showActionButton": {
"commit": false,
"publish": false,
"sync": false
}
Previous Answer
This feature was added in the September 2020 / version 1.61 update to Visual Studio Code and can be found on the release notes at https://code.visualstudio.com/updates/v1_61#_publish-or-sync-action-button-for-git-repositories.
The behaviour of this button can be adjusted in the VS Code settings, the setting is named "git: show unpublished commits button" with the options 'always', 'whenEmpty' and 'never'. The default is 'whenEmpty' so the button appears when there are unpublished changes, but no uncommitted changes. For your purposes I believe you would want to use the 'never' option.
Alternatively it can be set directly in settings.json as:
"git.showUnpublishedCommitsButton": "never"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With