Reputation: 766
I am currently in a project that uses TFS Git as the code repository. In Visual Studio, under Team Explorer -> Sync, there is an option called Sync. Now I am familiar with the Fetch, Pull, and Push actions but Sync is new to me.
Any ideas what this does behind the scenes?
Upvotes: 25
Views: 17780
Reputation: 51103
Git in Visual Studio, VSTS, and TFS is standard Git. Although Sync isn’t a Git command, some GUI environments provide a sync button to both update your local files and push your local changes to your remote (your hosted repository).
The Sync button is available on the Team Explorer pane and and also displayed after you create a commit using the extension. The sync tool enables you to select how you want to update the project:
- sync: performs a
git pull
and agit push
.- fetch: performs a
git fetch
which retrieves any commits on from your remote without merging them.- pull: performs a
git pull
.- push: performs a
git push
.
You can also navigate to the Synchronization view from the Changes view by choosing Sync immediately after making a commit.
Upvotes: 28
Reputation: 1732
Sync is a combination of a Pull Command followed by a Push command. It will 1st perform a Pull, and if there are no conflicts, will then Push the current branch. It is meant as a quick way to just get your current branch into sync with the remote branch.
Upvotes: 17