0

I'm new to git and bitbucket so I'm just having some trouble understanding everything, if anyone could give me a short explanation of what each of these does I would be very grateful.

Pull - Im assuming this gets new changes from the repository? What is the difference between "Pull" and "Fetch from upstream"?

Push Branch - This pushes your entire branch onto the repository? Whats the difference between Pushing and a Commit?

Rebase, Reset and Merge - These all sound like they do similar things, but what are the specific differences?

Thanks a lot

  • 1
    I would strongly suggest you take some time and study the book at https://git-scm.com/book/en/v2. Trust me, it will save you a lot of pain. – David Deutsch Feb 10 '16 at 21:42

1 Answers1

0

Pull does a fetch and merges them by default. Fetch as a standalone operation, would just update from the upstream however, this will not have any affect on the local code unless you do a merge.

When you commit saves your changes locally, and to reflect it on upstream, one should be pushing these changes to it.

Reset is basically resets your changes in the local repository, two famous flags are --hard and --soft, doing a hard reset would completely reset your local changes, however a soft one, would keep the local changes.

For rebasing and merge, I would suggest to read this post, http://stackoverflow.com/questions/16666089/whats-the-difference-between-git-merge-and-git-rebase

Ducaz035
  • 3,054
  • 2
  • 25
  • 45