What are the differences between git remote prune, git prune, git fetch –prune, etc

I don’t blame you for getting frustrated about this. The best way to look at is this. There are potentially three versions of every remote branch: The actual branch on the remote repository(e.g., remote repo at https://example.com/repo.git, refs/heads/master) Your snapshot of that branch locally (stored under refs/remotes/…)(e.g., local repo, refs/remotes/origin/master) And a local branch that might be tracking the … Read more

What is git fast-forwarding? [duplicate]

When you try to merge one commit with a commit that can be reached by following the first commit’s history, Git simplifies things by moving the pointer forward because there is no divergent work to merge together – this is called a “fast-forward.” For more : http://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging In another way, If Master has not diverged, instead … Read more

How to revert multiple git commits?

Expanding what I wrote in a comment The general rule is that you should not rewrite (change) history that you have published, because somebody might have based their work on it. If you rewrite (change) history, you would make problems with merging their changes and with updating for them. So the solution is to create … Read more

What is HEAD in Git?

You can think of the HEAD as the “current branch”. When you switch branches with git checkout, the HEAD revision changes to point to the tip of the new branch. You can see what HEAD points to by doing: In my case, the output is: It is possible for HEAD to refer to a specific revision … Read more