10

I like using the CLI for interacting with GIT but I'm trying to understand the VS Tools for Git extension for the benefit of some team members who would prefer not to 'CLI'.

The UI for VS Tools for Git extension has actions labeled FETCH and PUBLISH which sound like PULL and PUSH, but there are other actions within the UI that are labeled PULL and PUSH so that guess is weak.

So far, I don't think my confusion is with Git but rather with the Git tools for VS. I can do what I need to accomplish in the CLI, but I don't ever recall doing a FETCH or a PUBLISH action.

I'm somewhat new to Git but are these terms FETCH and PUBLISH even part of the Git vernacular?

David Tansey
  • 5,813
  • 4
  • 35
  • 51

1 Answers1

19

Fetch, pull and push are all standard Git commands. Type git help fetch, etc. from a console Window for the in-depth details, but it boils down to this:

  • fetch: bring in changes without merging them
  • pull: bring in changes and do merge them
  • push: send out your changes.

Publish is more interesting. Microsoft is expecting people to work in feature branches, but to merge those back in to the master branch before pushing (i.e. only share the end result with others, rather than cluttering up their repositories with short-lived branches). The Publish command lets you select branches that you do want to share with other users. See the Microsoft docs for further details.

Matthew Strawbridge
  • 19,940
  • 10
  • 72
  • 93
  • you wrote: fetch: bring in changes without merging them What does it mean if I have a local copy of a file edited by me and call fetch the file will be replaced? – user1238784 Nov 30 '18 at 16:06
  • `fetch` only affects your remote-tracking branches not your actual branches (see https://stackoverflow.com/questions/292357/). So this action shouldn't make any difference to your locally edited file, whether or not you've committed it to your local branch. However, normally you'd only fetch if you then wanted to merge those changes into your branch, and it's at that point that it might affect your file. Any changes will be merged in: you won't lose your own changes. – Matthew Strawbridge Dec 01 '18 at 23:43