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

Git for everyone

Git for everyone

Unless you have been living in a cave, Git is everywhere. Creative or engineering, you have directly encountered or will encounter Git in the workplace. A common misconception as well is that Git is only for teams? Regardless of work style or team size, Git is the tool that everyone should be using.

Get the Book
https://www.gitbook.io/book/anotheruiguy/gitforeveryone

Dale Sande

June 18, 2014
Tweet

More Decks by Dale Sande

Other Decks in Programming

Transcript

  1. How can I get to that file? Just open Terminal

    and then $ cd ~/Projects/ boilerplate/ && vi .gitignore
  2. How can I get to that file? Just open Terminal

    and then $ cd ~/Projects/ boilerplate/ && vi .gitignore OMG! That is weird? What do I do?
  3. How can I get to that file? Just open Terminal

    and then $ cd ~/Projects/ boilerplate/ && vi .gitignore OMG! That is weird? What do I do? Geeze, press the i key, go to this line and add <file path>/**/*. Then hit the esc key to save. To get out, type :wq, ok!?
  4. How can I get to that file? Just open Terminal

    and then $ cd ~/Projects/ boilerplate/ && vi .gitignore OMG! That is weird? What do I do? Geeze, press the i key, go to this line and add <file path>/**/*. Then hit the esc key to save. To get out, type :wq, ok!?
  5. Before VC or Branching my-project-folder my-project-folder-copy my-project-folder-copy-v2 Need to revert

    some code ;( Crap! Which folder has the right stuff? Ok, get these lines and then …
  6. Before VC or Branching my-project-folder my-project-folder-copy my-project-folder-copy-v2 Need to revert

    some code ;( Crap! Which folder has the right stuff? Ok, get these lines and then … NOTHING IS WORKING!!
  7. Before VC or Branching my-project-folder my-project-folder-copy my-project-folder-copy-v2 Need to revert

    some code ;( Crap! Which folder has the right stuff? Ok, get these lines and then … NOTHING IS WORKING!! Boss: Hey, we have a new person you will work with. You need to share code and work on solving problems together. ! ! You: SHIT! Dropbox, why you no scale?
  8. $ git branch $ git checkout master $ git pull

    origin master $ git checkout -b my-new-feature-branch
  9. $ git branch $ git checkout master $ git pull

    origin master $ git checkout -b my-new-feature-branch $ git checkout -b transaction-fail-message master
  10. $ git status $ git add . $ git add

    -u $ git add --all $ git commit -m "a commit message in the present tense"
  11. $ git commit -m "fixed bug with login feature" 

      $ git commit -m "update app config to address login bug"
  12. $ git branch -r << this will list remote branches

    $ git fetch -p << this will prune your local index   
  13. $ git branch -r << this will list remote branches

    $ git fetch -p << this will prune your local index    $ git checkout new-remote-feature-branch
  14. $ git checkout master $ git pull origin master 

      $ git merge --no-ff my-feature-branch
  15. $ cd ~/Desktop $ mkdir gitDemo $ cd gitDemo &&

    git status $ git init $ git status
  16. $ touch index.html $ mkdir stylesheets $ mkdir javascripts $

    cd stylesheets && touch app.css && cd ../
  17. $ touch index.html $ mkdir stylesheets $ mkdir javascripts $

    cd stylesheets && touch app.css && cd ../ $ cd javascripts && touch app.js && cd ../
  18. $ git add . $ git status $ git commit

    -m "update to function ..."
  19. $ git add . $ git status $ git commit

    -m "update to function ..." $ git status
  20. $ git add . $ git status $ git commit

    -m "update to function ..." $ git status # On branch master nothing to commit …
  21. $ git log $ git blame index.html ^15d42d5 (Dale Sande

    2014-06-10 18:25:26 -0700 1)   
  22. $ git add . $ git commit -m "update content

    and styles" $ git checkout master    
  23. $ which git     If a version

    of Git is not there! …
  24. $ brew install git    this is pretty

    metal PATH=/usr/local/bin:$PATH That goes in your ~/.bash_profile bro!
  25. $ cd ~/Desktop $ mkdir gitDemo $ cd gitDemo &&

    git status $ git init $ git status
  26. $ touch index.html $ mkdir stylesheets $ mkdir javascripts $

    cd stylesheets && touch app.css && cd ../
  27. $ touch index.html $ mkdir stylesheets $ mkdir javascripts $

    cd stylesheets && touch app.css && cd ../ $ cd javascripts && touch app.js && cd ../
  28.  <h1>Hello World</h1> That goes in your index.html h1 {

    font-size: 8em; } That goes in your app.css
  29.  <h1>Hello World</h1> That goes in your index.html h1 {

    font-size: 8em; } That goes in your app.css var today = new Date() That goes in your app.js
  30. $ git add . $ git status $ git commit

    -m "update to function ..."
  31. $ git add . $ git status $ git commit

    -m "update to function ..." $ git status
  32. $ git add . $ git status $ git commit

    -m "update to function ..." $ git status # On branch master nothing to commit …
  33. $ git log $ git blame index.html ^15d42d5 (Dale Sande

    2014-06-10 18:25:26 -0700 1)   
  34. $ git add . $ git commit -m "update content

    and styles" $ git checkout master