• Like
  • Save
M.Mozūras - git
Upcoming SlideShare
Loading in...5
×
 

M.Mozūras - git

on

  • 1,051 views

 

Statistics

Views

Total Views
1,051
Views on SlideShare
1,051
Embed Views
0

Actions

Likes
0
Downloads
8
Comments
0

0 Embeds 0

No embeds

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

    M.Mozūras - git M.Mozūras - git Presentation Transcript

    • git or: how I learned to stopworrying and love source control
    • why you should care
    • Traditional version controlsystems have deficiencies
    • Subversion, Perforce, CVS, TFS...
    • OH, TSLOW HE PATREE CONFLICTS IN!MERGING IS CHALLENGINGBRANCHES ARE JUST COPIES
    • using svn
    • using git
    • git is awesome
    • It’s distributed!Distributed Version Control System
    • Every repository is equal.
    • You can work offline.
    • Fast as lightning.
    • add status diff log commit branch git mercurial bazaar
    • Very efficient.git clone rails - 53 seconds40mb, 2356 files, 29045 commits
    • Great branching and merging.
    • Any workflow you want,you got it...
    • Shared repository
    • Linus Torvalds Blessed repositoryLieutenantsDevelopers
    • how to install
    • Linux: apt-get install git-coreMac OS X: brew install gitWindows: chocolatey install msysgit
    • Download from git-scm.com
    • gettingstarted
    • git config --global user.name ...git config --global user.email ...
    • git init
    • master has no special meaning.It’s just a default branch.
    • git add
    • Staging area stores info aboutwhat will go into next commit.
    • working staging area repositorydirectory checkout the project stage files commit
    • git commit
    • Commit “name” is a 40-digit SHA189f30b664981e4397625791c8ea3bbb5f2279a3
    • commit 189f30b... tree e8455...parent(s) nil author Mindaugas...committer Mindaugas... Initial commit
    • tree e8455...blob bc52a... README.md
    • blob bc52a...
    • SVN, CVS, Perforce storedifferences between commits.
    • Git stores snapshots.
    • commit0 commit1 commit2 tree0 tree1 tree2blob A blob A blob A2 blob B blob B2 blob B2
    • Basictrainingcomplete.
    • pushing and pulling
    • git remote add origin git@git...
    • git push origin master
    • git pull origin master
    • branching and merging
    • git branch name
    • Branch is a reference to thehead of a line of work.
    • masterC0 C1 feature
    • git checkout name
    • git merge name
    • masterC0 C1 C2 F1 F2 feature
    • masterC0 C1 C2 C3 F1 F2 feature
    • git rebase name
    • masterC0 C1 C2 F1 F2 feature
    • masterC0 C1 F1 F2 C2 feature
    • merge is fine, but in a lot ofcases, rebase is better.
    • Branching - too easy not to do
    • manipulatinghistory
    • git commit --amend
    • git rebase --interactive
    • Interactive rebase lets you:reword, edit, squash, fixup,exec, remove and reorder.
    • Be carefu l!You can change history of remoterepository with git push --force.
    • Rewritinghistory is funand useful!
    • git- svn
    • git svn clone http://...
    • git svn rebase ~ svn update
    • git svn dcommit ~ svn commit
    • GitHub
    • The best way to collaborate.
    • More than 1.6 million people, 2.8 million repositories.
    • Used by individuals.
    • And organizations.
    • closing thoughts
    • blame bisect cherry-pick cleancvsimport describe diff fetchfilter-branch grep request-pullrevert svnimport stashsubmodule tag and more...
    • RESgit-scm.com OURgitready.com CESgitimmersion.comontwik.com/category/git-github
    • Git != Subversion + Magic
    • The slogan of Subversion for awhile was "CVS done right". If youstart with that kind of slogan,theres nowhere you can go. Thereis no way to do CVS right. Linus Torvalds
    • thanks to:Zach Holman @holmanthenounproject.com
    • thanks!codingfearlessly.comtwitter.com/mmozurasgithub.com/mmozuras