Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Git, GitHub, Etc

Git, GitHub, Etc

How git and GitHub work, behind the scenes. Aka what I do in my day job.

Andy Delcambre

April 19, 2014
Tweet

More Decks by Andy Delcambre

Other Decks in Programming

Transcript

  1. yt $ git init Initialized empty Git repository in /private/tmp/demo/.git/

    yt $ echo "My sweet repo" > README yt ✗ $ git add README yt ✗ $ git status # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # # new file: README # yt ✗ $ git commit -m "Add a README" [master (root-commit) 8a720fa] Add a README 1 file changed, 1 insertion(+) create mode 100644 README yt $ git log commit 8a720fa06710948f2ab79dd3e213ef745b6000c5 Author: Andy Delcambre <[email protected]> Date: Mon Apr 14 15:41:34 2014 -0700 ! Add a README
  2. yt $ echo "It's so awesome" >> README yt ✗

    $ git add README yt ✗ $ git commit -m "Update README" [master ede0fc8] Update README 1 file changed, 1 insertion(+) yt $ git log --graph --decorate --pretty=oneline * ede0fc8 (HEAD, master) Update README * 8a720fa Add a README%
  3. enzo $ git init --bare demo.git Initialized empty Git repo

    in /home/adelcambre/git/demo.git/ ! yt $ git remote add origin adelcambre@enzo:git/demo.git yt $ git push origin master Counting objects: 6, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (6/6), 473 bytes, done. Total 6 (delta 0), reused 6 (delta 0) To adelcambre@enzo:git/demo.git * [new branch] master -> master ! yt $ git clone adelcambre@enzo:git/demo.git Cloning into 'demo'... remote: Counting objects: 6, done. remote: Compressing objects: 100% (2/2), done. remote: Total 6 (delta 0), reused 0 (delta 0) Receiving objects: 100% (6/6), done.
  4. yt $ git remote add -f origin [email protected]:adelcambre/demo.git Updating origin

    From github.com:adelcambre/demo * [new branch] master -> origin/master ! yt $ git push origin master Counting objects: 6, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (6/6), 473 bytes, done. Total 6 (delta 0), reused 6 (delta 0) To https://github.com/adelcambre/demo.git * [new branch] master -> master
  5. repo = Grit::Repo.new(“grit.git”) ! repo.commits # => [#<Grit::Commit "e80bbd2ce67651aa18e57fb0b43618ad4baf7750">, #<Grit::Commit

    "91169e1f5fa4de2eaea3f176461f5dc784796769">, #<Grit::Commit "038af8c329ef7c1bae4568b98bd5c58510465493">, #<Grit::Commit "40d3057d09a7a4d61059bca9dca5ae698de58cbe">, #<Grit::Commit "4ea50f4754937bf19461af58ce3b3d24c77311d9">]
  6. Git

  7. Questions! Git for Computer Scientists http://eagain.net/articles/git-for-computer-scientists/ My mom told me

    git doesn’t scale https://vimeo.com/64716825 GitHub Flow https://guides.github.com/introduction/flow/index.html How GitHub uses GitHub to build Github http://zachholman.com/talk/how-github-uses-github-to-build-github/