...
Code Block | ||
---|---|---|
| ||
# Get the latest main branch code before starting the feature (master) $ git pull (master) $ git checkout -b grp-1279 (grp-1279) #do work, make commits (grp-1279) #squash multiple commits together to a single new commit; e.g. here merge (grp-1279) #the last two commits by changing all but the first commit (grp-1279) #from "pick" to either "squash" (retain message) or "fixup" (ignore message) (grp-1279) $ git rebase -i HEAD~~ (grp-1279) $ git checkout master (master) #get any new commits (master) $ git pull (master) #if any new commits, go back to the feature branch and rebase. Fix conflicts and retest (master) $ git checkout grp-1279 (grp-1279) $ git rebase master (grp-1279) #Retest. Fix any conflicts that occurred during the rebase. Then continue below (grp-1279) $ git checkout master (master) #merge should be a clean fast-forward merge (master) $ git merge grp-1279 (master) $ git push (master) #the branch is merged, can delete it now (master) $ git branch -d grp-1279 |
...