Host: OpenUTD
Speaker: C. Michael Murphey
Contact: michael@murphey.org
git stash save "Refactor the thing"
git stash list
git stash apply
git stash push
Happens to the best of us...
git merge --squash
Note: this creates a completely new commit!!
git merge --ff-only # my favorite :)
git merge --ff # default
git merge --no-ff
git reset commitsha
git reset HEAD^1
git reset HEAD^1 --soft
git reset HEAD^1 --hard
git clean -dfx
git checkout file.txt
git checkout -- file-with-same-name-as-branch
What does git checkout -
do?
git stash save "Any changes I might have in progress"
git rebase master
Resolve merge conflicts
git rebase --continue
Note: This replaces a commit!!
git commit --amend
You get to change the contents of the commit and/or change the commit message
Note: This replaces a commit!!
Rewriting history is dangerous
Some people think it's wrong
Never do it on a branch that's not yours
Use git push --force-with-lease
--force-with-lease is safer
It ensures that the commits on the server are what we expect
You can edit .git/info/exclude if you want to ignore new files but don't want to edit .gitignore
All you have to do is change user.name and user.email
git-blame-someone-else makes trolling easy
GPG signatures for commits are built into git
Many sites like GitHub now show GPG signatures
git config --global user.signingkey KEYIDHERE
git commit -S
git log --show-signature
Add your public key to your GitHub account and verify signatures in the GitHub UI
Use imperative tense
"Do the thing" instead of "I did the thing"
hub clone caffeine-overload/bandinchina
hub fetch origin,upstream
hub pull-request
Xi Jinping looks like Winnie the Pooh