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.

Git Workshop

3,502 views

Published on

A workshop for installing git, initializing and comitting to a repository, and pushing the repository to github.com.

Published in: Technology
  • Be the first to comment

Git Workshop

  1. 1. git workshop<br />
  2. 2. ABOUT ME<br />Alex York<br />Consultant<br />www.alexyork.net<br />@alex_york<br />
  3. 3. “You stupid git!”<br />
  4. 4. msysgit<br />Git client for Windows<br />http://code.google.com/p/msysgit/<br />
  5. 5. Installing msysgit (1)<br />
  6. 6. Installing msysgit (2)<br />
  7. 7. Installing msysgit (3)<br />
  8. 8. Installing msysgit (4)<br />
  9. 9. Open “Git Bash”<br />
  10. 10. Names with Æ Ø Å<br />Add an environment variable for HOME<br />So that git will not look in:<br />C:UsersFollesø<br />Right click on My Computer<br />Advanced System Settings<br />Environment Variables<br />Add<br />
  11. 11. Names with Æ Ø Å<br />
  12. 12. Names with Æ Ø Å<br />
  13. 13. Names with Æ Ø Å<br />
  14. 14. First git command: check version<br />git --version<br />
  15. 15. Configure your email<br />git config --global user.email alex-york@hotmail.co.uk<br />
  16. 16. Configure your name<br />git config --global user.name “Alex York”<br />
  17. 17. Generate SSH keys<br />ssh-keygen –C  “alex-york@hotmail.co.uk”  –t rsa<br />That C is UPPERCASE!<br />
  18. 18. Generating SSH keys<br />Press Enter/Return when prompted for file location and your passphrase.<br />
  19. 19. Generated SSH keys<br />The public key will be used later on github.com.<br />Pro tip: make backups of these keys!<br />
  20. 20. Write some code!<br />
  21. 21. Navigating with Git Bash<br />cd /c/Code/NNUG-Hello-World/<br />
  22. 22. Initializing a repository<br />git init<br />
  23. 23. What just happened?<br />
  24. 24. View current status<br />git status<br />
  25. 25. Creating a .gitignore file<br />touch .gitignore<br />
  26. 26. View current status<br />git status<br />
  27. 27. Add to staging area<br />git add .<br />
  28. 28. Add to staging area<br />
  29. 29. Next: commit<br />After adding (and removing?) several times to the staging area...<br />... commit to the repository<br />committing is like a snapshot of your code<br />
  30. 30. Committing to repository<br />git commit –m “Commit message goes here”<br />
  31. 31. Committing to repository<br />
  32. 32. Commit log<br />git log<br />
  33. 33. github.com<br />
  34. 34. SSH Public Key<br />
  35. 35. New Repository (1)<br />
  36. 36. New Repository (2)<br />
  37. 37. You’ve created a github repo!<br />
  38. 38. Add your remote repository<br />git remote add origin<br />git@github.com:alexyork/NNUG-Hello-World.git<br />All on one line!<br />
  39. 39. Push to your remote repo<br />git push origin master<br />
  40. 40. github.com<br />
  41. 41. What next?<br />Find something cool on github<br />git clone git@github.com/whatever<br />Fork something<br />Add a feature, fix a bug<br />Create a pull request<br />Start up an open-source project!<br />
  42. 42. Based on this guide<br />Git For Windows Developers by Jason Meridth<br />http://www.lostechies.com/blogs/jason_meridth/archive/2009/06/01/git-for-windows-developers-git-series-part-1.aspx<br />These slides available at: www.alexyork.net<br />

×