What’s the difference between ‘git merge’ and ‘git rebase’?

What’s the difference between git merge and git rebase? 7 s 7 Suppose originally there were 3 commits, A,B,C: Then developer Dan created commit D, and developer Ed created commit E: Obviously, this conflict should be resolved somehow. For this, there are 2 ways: MERGE: Both commits D and E are still here, but we … Read more

Squash the first two commits in Git? [duplicate]

This question already has answers here: Combine the first two commits of a Git repository? (8 answers) Closed 7 years ago. With git rebase –interactive <commit> you can squash any number of commits together into a single one. That’s all great unless you want to squash commits into the initial commit. That seems impossible to … Read more

git cherry-pick says “…38c74d is a merge but no -m option was given”

I made some changes in my master branch and want to bring those upstream. When I cherry-pick the following commits. However, I get stuck on fd9f578 where git says: $ git cherry-pick fd9f578 fatal: Commit fd9f57850f6b94b7906e5bbe51a0d75bf638c74d is a merge but no -m option was given. What is git trying to tell me and is cherry-pick … Read more

Git refusing to merge unrelated histories on rebase

During git rebase origin/development the following error message is shown from Git: fatal: refusing to merge unrelated histories Error redoing merge 1234deadbeef1234deadbeef My Git version is 2.9.0. It used to work fine in the previous version. How can I continue this rebase allowing unrelated histories with the forced flag introduced in the new release? 3 … Read more