When does one use git rebase vs git merge?
Does one still need to merge after a successful rebase?
When does one use git rebase vs git merge?
Does one still need to merge after a successful rebase?
Short version: - Merge says take all the changes in one branch and merge them into another branch in one big commit - Rebase says I want the point at which I branched to move to a new starting point
So when do you use either one. Let's say you have created a branch for the purpose of developing a single feature. When you want to bring those changes back to master, you probably want merge (you don't care about maintaining all of the interim commits). A second scenario would be if you started doing some development and then another developer made an unrelated change. You probably want to pull and then rebase to base your changes from the current version from the repo.
I have a master branch and a spec-pass branch that are radically different. If I checkout master and go git status I am told I am ahead of origin/master by 2 commits, but that is due to an error a maligned git reset and git revert HEAD on master. All want to get, is that HEAD of master becomes HEAD of my specs-pass branch. How can I do that?
I guess I must first revert 2 steps on master so I am not ahead and then do a git rebase specs-pass followed by a merge?