Join the meet-up event https://www.meetup.com/WomenWhoCodeNYC/events/278095956/
Fork me! Clone me! CD into git_party
Checkout a branch "my-branch" Git Status Git Log
Make a Change Git status Git add . Git commit -m "First Commit" git push origin main --force Git log
Make a Second Change Git status Git add . Git status
#step 6 Git commit -m "Squash me!" Git status Git log
Git commit -m "Squash me!" Git push origin main --force Git log
Rebase!
- check 'git log'
- find the commits on your branch
- exit CLI by pressing 'esc' or 'q'
- write 'git rebase -i HEAD~#of commits (2 in this case)'
Squash your commits into one
- rebase in progress
- find commit move text input to front of line
- press 'cw' then type 'squash'
- press esc key and type ':wq!' to write your changes and quit
- next screen, move text input down to second message
- press 'dd' to delete lines of unwanted commit messages
- press esc key and type ':wq!' to write your changes and quit
Reset --hard
- check 'git log'
- write 'git reset --hard'
- check 'git log'
- 'git push origin --force'
- create a pr and check out your commit!
- 'git checkout master'
- rebase with master once your branch is out of date
- 'git stash' is another helpful tool to save WIP
- 'git stash list'
- 'git stash show (name)'
- 'git stash apply' to a branch