A couple additional commands that have saved me quite a bit of trouble/work:
git reflog & git cherry-pick.
reflog sort of allows you to view a complete git history of what's happened. It's more extensive than commits cause it includes merges and rebases. So if you have a rebase that goes wrong, you can use reflog to figure out what point in history you need to jump back to and then jump back to that history.
cherry-pick allows you to cherry-pick commits from one branch to another. This is particularly useful if you find yourself putting to much "unrelated" work into a single branch and you need to start a new branch and grab some work you've already done. git cherry-pick <commit-hash>. It'll grab the commit and put it in the branch your working on. It's pretty great.
Software Developer for as long as I can remember, building startups and projects. I've worked mostly in analytics, devops, and data science research. Running has proved useful so I enjoy doing it.
These are great!
A couple additional commands that have saved me quite a bit of trouble/work:
git reflog
&git cherry-pick
.reflog
sort of allows you to view a complete git history of what's happened. It's more extensive than commits cause it includes merges and rebases. So if you have a rebase that goes wrong, you can usereflog
to figure out what point in history you need to jump back to and then jump back to that history.cherry-pick
allows you to cherry-pick commits from one branch to another. This is particularly useful if you find yourself putting to much "unrelated" work into a single branch and you need to start a new branch and grab some work you've already done.git cherry-pick <commit-hash>
. It'll grab the commit and put it in the branch your working on. It's pretty great.So that's what
reflog
does! Very useful, thanks!