Combine 2 Commits That Are NOT The Last 2 Commits On My Branch
I have to following 4 commits:
#Commit4 #Commit3 #Commit2 #Commit1
After making commits 3 and 4 I realized my first 2 commits really should be a single commit like so:
#Commit4 #Commit3 #Commit1_and_commit2
Is an interactive rebase recommended for this or is there a better approach? Steps to follow would be great. Thanks.
Interactive rebase is far and away the easiest approach (though in fact it does nothing you couldn't do in some more difficult, manual way). You will need to say
git rebase -i --root
if commit 1 really is the very first commit. If not, you need to say
git rebase -i parentOfCommit1
You will then be shown a pick list of your four commits:
pick pick pick pick
You will change that to
pick squash pick pick
and you'll be all set.
- → Authenticate with a cookie using laravel 5.1 and jwt
- → Finding a specific GitLab tag from PHP
- → React: How to publish page on server using React-starter-kit
- → babel-loader, webpack, ES2015 modules: "Element type is invalid"
- → Create a function-attribute of a function, which is, in its turn, a method of an object literal
- → Model Validation in laravel 5.1 not working
- → GIT fatal: loose object
- → Laravel validation required rule not working
- → Axios array map callback
- → Where does this `webpack://` come from for `webpack-dev-middleware`?
- → error when trying to modify project in laravel forge
- → GitHub Pages and Jekyll content duplication and SEO issues
- → Use Laravel repositories with Datatables