GiTFO

1,037 views
868 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,037
On SlideShare
0
From Embeds
0
Number of Embeds
18
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

GiTFO

  1. 1. Git-TFO A bumblers guide to using Git
  2. 2. Github.com While it makes things easier, you don’t have to use it. “Following” people on Github doesn’t GIT you Klout
  3. 3. Local Setup Know which branch you are in using Bash: http://www.jonmaddox.com/2008/03/13/show-your
  4. 4. Local Setup [mubix@evil:~]$ cat .gitconfig [user] name = Rob Fuller email = jd.mubix@gmail.com [github] user = mubix [alias] ci = commit st = status co = checkout
  5. 5. Local Setup [mubix@evil:~]$ cat .ssh/config Host github.com User git Hostname github.com PreferredAuthentications publickey IdentityFile /var/logs/auth.log.gz
  6. 6. Add it’s upstream git remote add upstream git://github.com/rapid7/metasploitframework.git Doesn’t have to be called ‘upstream’ git fetch upstream git merge upstream/master DO NOT git pull upstream master
  7. 7. Previously unknown Internet meme
  8. 8. Forking
  9. 9. Forking leads to... Headaches Staying up all night Nausea Excessive use of coffee
  10. 10. Fork a repository Dead simple....
  11. 11. Set up your local copy git clone git@github.com:NoVAHA/metasploitframework.git proceed to screw things up
  12. 12. Fetch, Pull, Push, Merge Definitely coded/designed by testosterone Fetch, gets changes but gives you the chance handle conflicts Pull, auto merges changes Merge
  13. 13. git branch Use branches, working on ‘master’ will only cause you to get gray hairs
  14. 14. Stash (non-committal) git stash save “xyz fix” (work on something else) git stash apply git stash list
  15. 15. git reset/revert reset undoes uncommitted changes can be used to fix things when on a fork revert makes a new commit that undoes a previous commit
  16. 16. It’s committed and you are dumb git branch old git reset --hard HASH_FROM_UPSTREAM git pull upstream master (shouldn’t need anything) git push origin :master git push origin master Then salvage what you need from ‘old’
  17. 17. GUIs Free ‘Github’ for Mac SourceTree (awesomesauce) (also Mac)
  18. 18. Thanks... Rob And don’t work on master!

×