Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Getting Git...before it gets you

658 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Getting Git...before it gets you

  1. 1. GETTING GIT…before it gets you
  2. 2. HOW TO BE GOTTEN I am „notmessenger‟ in most networks and notmessenger.com/contact has the rest of the ways to find me
  3. 3. WHAT IS IT?
  4. 4. IT‟S THE NEW HOTNESS! Source code management system Version control and …. Distributed!
  5. 5. DISTRIBUTED? There is no central server where your repository must be maintained  Also referred to as being “Decentralized” Everything you need to maintain a repository is already on your local machine (once you have installed Git)
  6. 6. KEY CONCEPTS
  7. 7. REMEMBER THESE! Distributed Staging Area  …or Index  …or Cache  …or Directory cache  …or Current directory cache  …or Staged files
  8. 8. STAGING AREA
  9. 9. WHERE GIT EXCELS
  10. 10. MORE AWESOMENESS! Branches  Merging Stashes
  11. 11. COMMANDS
  12. 12. INIT Create a new repository  Can be empty directory  Can be existing codebase Example: > git init
  13. 13. CONFIG Manage configuration Example: > git config --global user.name „Jeremy Brown‟ > git config --global user.email „jeremy@notmessenger.com‟
  14. 14. STATUS Display the state of your codebase  Has anything been modified or staged since the last commit? Example: > git status
  15. 15. DIFF Show diff between states of codebase Example: > git diff <filename>
  16. 16. ADD Start tracking new files Stage changes to already-tracked files Example: > git add . > git add NEWFILE > git add ALREADY_EXISTENT_FILE
  17. 17. COMMIT Record the snapshot of your staged content Example: > git commit > git commit -m “Commit message” > git commit -a > git commit -am “Commit message”
  18. 18. LIVE DEMO
  19. 19. COLLABORATION
  20. 20.  Git doesn‟t have a central server, such as how SVN or others do You collaborate by synchronizing with other repositories There is no real difference between a server and client – a Git repository is a Git repository and you can synchronize between any two easily
  21. 21. MORE COMMANDS
  22. 22. CHECKOUT Checkout a branch from a remote repository to working directory Example: > git checkout <branchname>
  23. 23. FETCH Download new branches and data from a remote repository Is a separate copy of the data from the remote repository – it is not merged with your local working copy Can then look through new commits, view logs, etc Example: > git fetch > git fetch [alias] > git fetch --all
  24. 24. PULL First issues a FETCH command and then a MERGE command Example: > git pull > git pull [alias] > git pull --all
  25. 25. PUSH Push your new branches and data to a remote repository If someone else has pushed since the last time you fetched and merged the Git server will deny your push until you are up to date Example: > git push [alias] [branch]
  26. 26. REMOTE List, add and delete remote repository aliases Example: > git remote > git remote add [alias] [url] > git remote rm [alias]
  27. 27. BRANCH List, create or delete branches Example: > git branch > git branch <branchname> > git branch –d <branchname>
  28. 28. MERGE Merge any branch into the current branch Example: > git merge <branchname> > git merge --no-commit <branchname>
  29. 29. STASH Takes the dirty state of your working directory and saves it on a stack of unfinished changes that you can reapply at any time Example: > git stash > git stash list > git stash apply <stashname> > git stash drop <stashname>
  30. 30. LIVE DEMO
  31. 31. GUI TOOLS
  32. 32. MAKE YOUR LIFE EASIER GitHub for Mac/Windows/Eclipse/Mobile Git Tower Gitbox GitX SmartGit
  33. 33. DEMO OF GIT TOWER
  34. 34. CODE MANAGEMENTSTRATEGIES
  35. 35. HOW IS GIT GOING TO GETYOU?
  36. 36. LOOKOUT! A few of the differences between it and previous generations of SCMs  The index (or stage)  Distributed  Commit history Git is the new hotness and is being used (virtually) everywhere
  37. 37. GOT IT?
  38. 38. RESOURCES git-scm.com git-tower.com github.com/nvie/gitflow
  39. 39. IMAGE CREDITS Slide 1 - joecrazy.com/wp-content/uploads/2012/05/14.jpg Slide 5 - jpegy.com/images/uploads/2012/03/battleshots.jpg Slide 9 - learn.github.com/images/staging.png Slide 11 - moustachemadness.files.wordpress.com/2012/02/handlebar- moustache.jpg

×