Hello git :)
<me>
Josh Dvir
josh@tooveo.com
@shukydvir
</me>
Founder & CTO @
Get git:
Mac: $ brew install git
Linux: $ apt-get install git-core
Windows: msysgit
version control
CVS or SVN
mercurial (hg)
bazaar
subversion (svn)
concurrent version system (cvs)
preforce
visual source safe
“not bad”mercurial (hg)
bazaar
subversion (svn)
concurrent version system (cvs)
preforce
visual source safe
“kill self”
mercurial (hg)
bazaar
subversion (svn)
concurrent version system (cvs)
preforce
visual source safe
mercurial (hg)
bazaar
subversion (svn)
concurrent version system (cvs)
preforce
visual source safe
git
What is git?
git is an open source,
distributed version control
system designed for speed
and efficiency
Who uses git?
git is an open source,
distributed version control
system designed for speed
and efficiency
git-scm.com
git is an open source,
distributed version control
system designed for speed
and efficiency
Fully Distributed
(almost) everything is local
everything is fast
every clone is a backup
work offline
No Network Needed
Performing a diff
Viewing file history
Committing changes
Merging branches
Obtaining other revisions of ...
git is an open source,
distributed version control
system designed for speed
and efficiency
(almost) never removes data
Snapshots, not Patches
Starting with git
$ git config --global user.name “Josh Dvir”
$ git config --global user.email “josh@tooveo.com”
Getting a repo
Create One:
$ git init
Clone One:
$ git clone
Basic commands:
● Add a file (git add)
● Commit changes (git commit)
● See logs (git log)
● Remove a file (git rm)
● Jump ...
Workshop
start your laptops...
git init
$ cd /path/to/repos
$ mkdir project_name
$ cd project_name
$ git init
$ ls -alh
git add
$ touch README
$ echo “Read Me” >> README
$ echo “Learn git!” > TODO
$ git add . # will add all files
git status
$ git status
$ git commit -m “Adding 2 files”
# TODO and README committed to git.
$ git status # no changes
git commit
git branch
$ git branch my_awesome_branch
$ echo “dude file changed” >> README
$ git status
# README is staged to commit.
...
git checkout
$ git checkout master
git merge
$ git merge my_awesome_branch
$ git log
# see the new commit
github.com
bitbucket.org
code.google.com
$ git remote add origin git@github.com:username/project.git
git remote
$ git push origin master
$ git push other_remote master
$ git push third_remote my_awesome_branch
git push
$ git pull origin master
$ git pull other_remote master
git pull
github flow
● Anything in the master branch is deployable
● To work on something new, create a descriptively named
branch off of maste...
1. http://git-scm.com/
2. http://www.slideshare.net/chacon/git-101-
presentation
3. http://scottchacon.com/2011/08/31/gith...
Hello git
Hello git
Upcoming SlideShare
Loading in …5
×

Hello git

424 views

Published on

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

No Downloads
Views
Total views
424
On SlideShare
0
From Embeds
0
Number of Embeds
26
Actions
Shares
0
Downloads
7
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Hello git

  1. 1. Hello git :)
  2. 2. <me> Josh Dvir josh@tooveo.com @shukydvir </me> Founder & CTO @
  3. 3. Get git: Mac: $ brew install git Linux: $ apt-get install git-core Windows: msysgit
  4. 4. version control
  5. 5. CVS or SVN
  6. 6. mercurial (hg) bazaar subversion (svn) concurrent version system (cvs) preforce visual source safe
  7. 7. “not bad”mercurial (hg) bazaar subversion (svn) concurrent version system (cvs) preforce visual source safe
  8. 8. “kill self” mercurial (hg) bazaar subversion (svn) concurrent version system (cvs) preforce visual source safe
  9. 9. mercurial (hg) bazaar subversion (svn) concurrent version system (cvs) preforce visual source safe git
  10. 10. What is git?
  11. 11. git is an open source, distributed version control system designed for speed and efficiency
  12. 12. Who uses git?
  13. 13. git is an open source, distributed version control system designed for speed and efficiency
  14. 14. git-scm.com
  15. 15. git is an open source, distributed version control system designed for speed and efficiency
  16. 16. Fully Distributed
  17. 17. (almost) everything is local
  18. 18. everything is fast every clone is a backup work offline
  19. 19. No Network Needed Performing a diff Viewing file history Committing changes Merging branches Obtaining other revisions of a file Switching branches
  20. 20. git is an open source, distributed version control system designed for speed and efficiency
  21. 21. (almost) never removes data
  22. 22. Snapshots, not Patches
  23. 23. Starting with git
  24. 24. $ git config --global user.name “Josh Dvir” $ git config --global user.email “josh@tooveo.com”
  25. 25. Getting a repo
  26. 26. Create One: $ git init
  27. 27. Clone One: $ git clone
  28. 28. Basic commands: ● Add a file (git add) ● Commit changes (git commit) ● See logs (git log) ● Remove a file (git rm) ● Jump to commit or branch (git checkout) ● Create branch (git branch branch_name) ● Put aside temporary changes (git stash) ● Merge branches (git merge) ● Push commits (git push) ● Pull commits (git pull)
  29. 29. Workshop start your laptops...
  30. 30. git init $ cd /path/to/repos $ mkdir project_name $ cd project_name $ git init $ ls -alh
  31. 31. git add $ touch README $ echo “Read Me” >> README $ echo “Learn git!” > TODO $ git add . # will add all files
  32. 32. git status $ git status
  33. 33. $ git commit -m “Adding 2 files” # TODO and README committed to git. $ git status # no changes git commit
  34. 34. git branch $ git branch my_awesome_branch $ echo “dude file changed” >> README $ git status # README is staged to commit. $ git commit -m “README has changed”
  35. 35. git checkout $ git checkout master
  36. 36. git merge $ git merge my_awesome_branch $ git log # see the new commit
  37. 37. github.com bitbucket.org code.google.com
  38. 38. $ git remote add origin git@github.com:username/project.git git remote
  39. 39. $ git push origin master $ git push other_remote master $ git push third_remote my_awesome_branch git push
  40. 40. $ git pull origin master $ git pull other_remote master git pull
  41. 41. github flow
  42. 42. ● Anything in the master branch is deployable ● To work on something new, create a descriptively named branch off of master ● Commit that branch locally and regularly push your work to the same named branch on the server. ● When you need feedback or help, or you think the branch is ready for merging, open a pull request. ● After someone else has reviewed and signed off on the feature, you can merge it into master ● Once it is merged and pushed to master, you can and should deploy immediately.
  43. 43. 1. http://git-scm.com/ 2. http://www.slideshare.net/chacon/git-101- presentation 3. http://scottchacon.com/2011/08/31/github- flow.html 4. http://rogerdudler.github.io/git-guide/ 5. http://gitimmersion.com/ Resources:

×