Hello git

  • 162 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
162
On Slideshare
0
From Embeds
0
Number of Embeds
2

Actions

Shares
Downloads
4
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Hello git :)
  • 2. <me> Josh Dvir josh@tooveo.com @shukydvir </me> Founder & CTO @
  • 3. Get git: Mac: $ brew install git Linux: $ apt-get install git-core Windows: msysgit
  • 4. version control
  • 5. CVS or SVN
  • 6. mercurial (hg) bazaar subversion (svn) concurrent version system (cvs) preforce visual source safe
  • 7. “not bad”mercurial (hg) bazaar subversion (svn) concurrent version system (cvs) preforce visual source safe
  • 8. “kill self” mercurial (hg) bazaar subversion (svn) concurrent version system (cvs) preforce visual source safe
  • 9. mercurial (hg) bazaar subversion (svn) concurrent version system (cvs) preforce visual source safe git
  • 10. What is git?
  • 11. git is an open source, distributed version control system designed for speed and efficiency
  • 12. Who uses git?
  • 13. git is an open source, distributed version control system designed for speed and efficiency
  • 14. git-scm.com
  • 15. git is an open source, distributed version control system designed for speed and efficiency
  • 16. Fully Distributed
  • 17. (almost) everything is local
  • 18. everything is fast every clone is a backup work offline
  • 19. No Network Needed Performing a diff Viewing file history Committing changes Merging branches Obtaining other revisions of a file Switching branches
  • 20. git is an open source, distributed version control system designed for speed and efficiency
  • 21. (almost) never removes data
  • 22. Snapshots, not Patches
  • 23. Starting with git
  • 24. $ git config --global user.name “Josh Dvir” $ git config --global user.email “josh@tooveo.com”
  • 25. Getting a repo
  • 26. Create One: $ git init
  • 27. Clone One: $ git clone
  • 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. Workshop start your laptops...
  • 30. git init $ cd /path/to/repos $ mkdir project_name $ cd project_name $ git init $ ls -alh
  • 31. git add $ touch README $ echo “Read Me” >> README $ echo “Learn git!” > TODO $ git add . # will add all files
  • 32. git status $ git status
  • 33. $ git commit -m “Adding 2 files” # TODO and README committed to git. $ git status # no changes git commit
  • 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. git checkout $ git checkout master
  • 36. git merge $ git merge my_awesome_branch $ git log # see the new commit
  • 37. github.com bitbucket.org code.google.com
  • 38. $ git remote add origin git@github.com:username/project.git git remote
  • 39. $ git push origin master $ git push other_remote master $ git push third_remote my_awesome_branch git push
  • 40. $ git pull origin master $ git pull other_remote master git pull
  • 41. github flow
  • 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. 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: