• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Git tutorial

Git tutorial






Total Views
Views on SlideShare
Embed Views



0 Embeds 0

No embeds



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.

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

    Git tutorial Git tutorial Presentation Transcript

    • + Distributed Version Control Nuttapon Pattanavijit
    • Reference • http://git-scm.com • https://www.atlassian.com/git/tutorial
    • 1. WTF is Version Control ?
    • Collaboration
    • If someone blow up your code! what will you do if you use something like dropbox?
    • Snapshot sounds good
    • Snapshot sounds good?
    • Local Version Control
    • Centralized Version Control Systems
    • Distributed Version Control System git is DVCS
    • 2. Git?
    • History of Git • Developed for Linux Kernel project. • Speed, Simple design • Non-linear development • Fully distributed • Able to handle large projects
    • Snapshot of project over time basically takes a picture of what all your files look like at that moment and stores a reference to that snapshot. To be efficient, if files have not changed, Git doesn’t store the file again—just a link to the previous identical file it has already stored.
    • Git workflow 1. You modify files in your working directory. 2. You stage the files, adding snapshots of them to your staging area. 3. You do a commit, which takes the files as they are in the staging area and stores that snapshot permanently to your Git directory.
    • 3. Git Basic
    • Git Basic git init initializes new repository git clone create a copy
    • Git Basic
    • Git Basic git add add files to staging git commit snapshot project
    • 4. Undoing changes
    • Undoing Changes git checkout previous version git revert undo committed snapshot git reset undo changes in working directory
    • 5. Branching
    • git branch testing
    • git checkout testing
    • git commit -a -m “made a change”
    • git checkout master
    • git commit -a -m “made other changes”
    • 6. Merging
    • git checkout master git merge iss53
    • git checkout master git merge iss53
    • If two branches edit same file? How to handle merge conflict?
    • 7. Remote Repositories
    • Demo
    • Remote Repositories git pull fetch + merge into current branch git push update local repo to remote repo
    • 8. Feature Branch Workflow
    • git checkout -b my_feature master = git checkout master git branch my_feature
    • git push -u origin master
    • git pull
    • git push -u origin my_feature git checkout master git pull git merge my_feature git push