-
Notifications
You must be signed in to change notification settings - Fork 386
Git notes
Rand McKinney edited this page Nov 10, 2016
·
1 revision
These are just some random notes for git
commands that may come in handy.
If you've made some local changes, but not yet pushed them; and you just want to start over:
git reset --hard HEAD
When you have a bunch of commits to branch and you want to squash them into one before merging a PR:
Checkout your branch and list all the commits:
git clone https://github.com/strongloop/<repo>.git -b <branch>
cd <repo>
git log
Find the SHA of the last commit before you branched:
git reset --soft ddc29a3655b252296bf0675b28b63dd9e7bbcc45
git status
git commit -m "Comment here"
git push -f