True Git

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →
mchelem
February 12, 2014

True Git

Using git through command line and graphical user interfaces.

mchelem

February 12, 2014

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

54 slides
  1. $ git status On branch master Changes to be committed:

    (use "git reset HEAD <file>..." to unstage) new file: README Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: benchmarks.rb
  2. $ git diff @@ -36,6 +36,10 @@ def main +

    print “hi, git” - print “hi, svn”
  3. $ git log commit ca82a6dff817ec66f Author: Fernando <[email protected]> Date: Mon

    Mar 17 21:52:11 2013 -0700 Fix log out feature (issue #1)
  4. * You modify files in your working directory. * You

    stage the files, adding snapshots of them to your staging area. * You do a commit, which takes the files as they are in the staging area and stores that snapshot permanently to your Git directory.
  5. $ git checkout -b my_branch $ git add sample_text.txt $

    git commit -m “Add a poem about the singularity”
  6. Push push me and then just touch me till i

    can't get my satisfaction, satisfaction...
  7. $ git merge issue27 Auto-merging index.html CONFLICT (content): Merge conflict

    in index.html Automatic merge failed; fix conflicts and then commit the result
  8. $ git status On branch master You have unmerged paths.

    (fix conflicts and run "git commit") Unmerged paths: (use "git add <file>..." to mark resolution) both modified: index.html
  9. $ git blame -L 12,22 sample_text.txt ^4832fe2 (Fernando 2014-02-11 10:31:28

    -0700 12) if (this.id == myThread.id) ^4832fe2 (Fernando 2014-02-11 10:31:28 -0700 13) myThread.suicide()
  10. Git Book: http://git-scm.com/book Rebase vs Merge wars: http://stackoverflow. com/questions/457927/git-workflow-and-rebase-vs-merge- questions

    Why is merging in Git better than in SVN: http://stackoverflow.com/questions/2471606/how-and-or- why-is-merging-in-git-better-than-in-svn/2472251#2472251 There is much more to it

More Decks by mchelem

Other Decks in Programming