http://career.guru99.com/top-40-interview-questions-on-git/
fetch vs pull
Merge vs Rebase
fetch vs pull
fetch
will download any changes from the remote branch, updating your repository data, but leaving your local branch unchanged.pull
will perform a fetch
and additionally merge
the changes into your local branch.Merge vs Rebase
- Merge takes all the changes in one branch and merge them into another branch in one commit.
- Rebase says I want the point at which I branched to move to a new starting point
merge
does not change the ancestry of commits. A rebase
rewrites the ancestry of your local commits.