• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Hello git
 

Hello git

on

  • 259 views

 

Statistics

Views

Total Views
259
Views on SlideShare
258
Embed Views
1

Actions

Likes
1
Downloads
4
Comments
0

1 Embed 1

http://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Hello git Hello git Presentation Transcript

    • 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 a file Switching branches
    • 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 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)
    • 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 commit -m “README has changed”
    • 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 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.
    • 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: