Intro
Git
Rebase
- Several ways to get branches in sync
- git merge master -> merge commit
- gitx
- Roll it back
- git reflog
- git reset --hard HEAD@{1}
- gitx
- git rebase master
- gitx
- git rebase master --interactive
- jdjcws:wq
- keep only last message
- gitx
Bisect
- Has this ever happened to you? I just found a bug, and it's bad
- ./new_test.sh
- git lg
- git bisect start
- git bisect good 2b241
- git bisect bad
- git lg -> where are we?
- ./new_test.sh
- git bisect good
- git lg -> more refs added
- test/bisect until found
- git show -> oh, okay, I know how to fix that
- git lg
- git bisect reset
- git lg
- But what if there really was 10 years of history? What if the test took 2 hours to run?
- git bisect good 2b241 / enter
- git bisect bad
- git bisect run ./new_test.sh -> go home for the weekend
- git bisect reset
Submodule
- As a project matures, you find that parts can be broken out
- git submodule add ../bisect; git commit -m 'Add submodule'
- git show
- cd bisect
- git lg
- Wait, didn't this project have a security issue?
- git checkout bf4a9
- cd ..
- git diff
- git commit -am 'Avoid security issue'
- Caveat: submodules can be tricky because of git's default behavior
- tree
- git clone . sm; cd sm; tree -> bisect is empty!
- git submodule update --init; tree
Filter-Branch
- Rewrite all the things
- git lg
- take credit for someone else's work
- git filter-branch --env-filter 'GIT_AUTHOR_NAME=Me' HEAD~10..HEAD
- git lg
- Remove sensitive information
- ls
git filter-branch -f --tree-filter 'rm -f pom.xml' -- --all
- ls
- Convert a package into a separate repo
git filter-branch -f --subdirectory-filter src --prune-empty -- --all
- ls
Shell
- May have noticed my prompt
- vi ~/.bash_profile
- CLICOLOR -> color for basic commands by default
- git-completion: tab completion for named things
G
- Zap when dirty
- :q
- touch hi
- vi ~/.gitconfig
- color.ui=true
- lg alias
GitHub
Pull Requests
- help article
- rails/rails #9011
- Epic pull requests
- delorean += flux capacitor
Emoji
- Markdown cheat sheet
- ben/libgit2/issues/new
- Add emoji
- preview
- http://emoji-cheat-sheet.com
Subversion
- svn co svn co https://github.com/retlehs/roots
- tree -AL 2 roots
- Great way to get your boss to let you use GitHub
Hub
- alias git=hub
- git browse twitter/iago
- git clone twitter/iago
- cd iago
- git browse
GHfW
- GH account/repos
- History view
- Open Shell Here
- touch hi
- Zoom in on shell prompt