Git is my hero

2,350 views

Published on

Very short talk on revision control systems and intro to git. Given at Code-N-Splode on September 23, 2008.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,350
On SlideShare
0
From Embeds
0
Number of Embeds
17
Actions
Shares
0
Downloads
47
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Git is my hero

  1. 1. Git is my hero Selena Deckelmann
  2. 2. Not this guy:
  3. 3. Git is my hero
  4. 4. More like this:
  5. 5. BEFORE: cp specialfile.c specialfile.c.bak vi specialfile.c cp specialfile.c specialfile.c.200809221522 ls -alr AFTER: git init git add specialfile.c git commit -m “making changes” vi specialfile.c git commit -a -m “made change, saved world”
  6. 6. Why REVISION CONTROL?
  7. 7. Figure out what you did (later) Document what you did (right then) Use tools designed for this
  8. 8. A short history of Revision Control Systems:
  9. 9. Ancient: SCCS (1972) Old School: RCS (ci / co) Centralized: CVS / Subversion Decentralized: Git / Mercurial / Bazaar / SVK
  10. 10. DOWNLOAD: http://git.or.cz/
  11. 11. Quickly: git clone git log git init git status git diff git commit git revert
  12. 12. DEMONSTRATION
  13. 13. Important notes: changing file names (git mv)
  14. 14. Important notes: directories (if they're empty, git doesn't care about them) there's a way around this: .gitignore
  15. 15. Empty directory recipe for .gitignore: * !.gitignore Note: Rules are recursive
  16. 16. Best Practice: designate a place for “authoritative” storage
  17. 17. Important notes: pushed changes aren't automatically shown in checked-out files (in the “authoritative” repo) Best practice: don't check out in the central repo
  18. 18. Do things once: git remote add NAME $URL
  19. 19. Git URLs: /home/you/git git://user@host/path/to/git ssh://user@host/path/to/git http://somehost.com/git
  20. 20. REMOTES URL create with a refspec, located in one of: .git/config .git/remotes .git/branches Or on the command-line.
  21. 21. git add remote community9 ssh://selena@blah/home/selena/pg_top/ makes this: [remote “community9”] url = ssh://selena@blah/home/selena/pg_top/ fetch = +refs/heads/*:refs/remotes/community9/*
  22. 22. More fun: git stash git branch git reset git push git pull get fetch git merge git rebase - DANGER!

×