Home > Enterprise >  VS Code Git Lens: Does "Sync changes" sync or push?
VS Code Git Lens: Does "Sync changes" sync or push?

Time:04-12

When I have committed all my changes, git lens in VS Code offers me to "sync changes". When I hover over the button however, it says "push commits to remote repository"

enter image description here

Aren't push and sync different things? AFAIK "sync" pulls and then pushes, while "push" only pushes.

So... what does the button actually do?

CodePudding user response:

You are correct that sync does both a pull and a push, but that specific button only shows what it thinks you need to do. In your case it thinks you are 1 commit ahead so you only need to push. (Note I say "thinks" because there may be commits out on the remote that you haven't fetched yet.) If your branch has diverged from the remote, then that button will show both arrows with the specific numbers of commits needed both ways.

  • Related