Mastering

Time and Space

git explained in one image

( Source: http://tartley.com/?p=1267 )

Why git is strange...

Your Code

Your Code Repo

Without git...

  • You are subject to the timeline of the universe
    • You can't go back. You can't go forward.
  • Cause and effect rules you
    • Merge conflict === One huge blob of code in your timeline
  • Only one universe exists. 
    • So don't break it!

With git...

  • You author time and space
    • Code and the timeline of code
  • You can alter cause and effect
    • Commits can be altered to flow smoothly with the timeline
  • As many timelines and universes as you want
    • You can fork any point of a timeline into a new one

Undo is deprecated 

  • Undo is for primitive time travelers
  • Users of git are architects of time and space

Spacetime Architecture 101

( source: NASA )

Fundamental particle of git Spacetime 

commit 9f45df93ea8b16398196523201e7e618d858799d
Author: Brian Graham <drakain@gmail.com>
Date:   Sat Aug 8 22:36:53 2015 -0400

    Adds basic view for individual message body

diff --git a/app/AppKernel.php b/app/AppKernel.php
index 9f45755..9229c88 100644
--- a/app/AppKernel.php
+++ b/app/AppKernel.php
@@ -14,8 +14,8 @@ class AppKernel extends Kernel
             new Symfony\Bundle\MonologBundle\MonologBundle(),
             new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
             new Symfony\Bundle\AsseticBundle\AsseticBundle(),
-            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
             new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
+            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
             new Incognito\Bundle\MailQueueViewBundle\IncognitoMailQueueViewBundle(),
         );

Fundamental force of git spacetime 

*   558a2e9 Merge pull request #78 from svpernova09/bug/themes-doc-syntax-errors
|\  
| * 4685c39 Fix syntax errors in themes documentation
|/  
*   e96f4ae Merge pull request #77 from opdavies/update-url
|\  
| * 5b3a4fa New URL
|/  
*   8a93275 Merge pull request #76 from dshafik/patch-1
|\  
| * 3926efc Add securepasswords.info
|/  
* 017d626 Getting ready for auto deploy!
*   f521fe1 Merge pull request #75 from bmackinney/patch-1
|\  
| * 868f99f Add Pantheon Docs to powered-by

Patch like you mean it

Patch like you mean it

Patch like you mean it

Patch like you mean it

Arrange particles from non-linear sources

Arrange particles from non-linear sources

Arrange particles from non-linear sources

Arrange particles from non-linear sources

Arrange particles from non-linear sources

git checkout feature/API-users

git cherry-pick "Api should handle exceptions"

Order your particles

  • Rebase
  • Interactive rebase

Order your particles

  • Rebase
  • Interactive rebase

Rewrite history as if it never changed

Filter-branch

 

git filter-branch --tree-filter "find . -type f -exec sed -i -e 's/target/replace/g' {} \;"

The meta-universe workspace is chronological

  • Reflog

Title Text

https://try.github.io/levels/1/challenges/1

http://pcottle.github.io/learnGitBranching/

pro-git book

 

Git: Mastering time and space

By Brian Graham

Git: Mastering time and space

Learn how git is used to architect the Spacetime of a code base.

  • 1,028