Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Git & GitHub for Beginners

9 406 vues

Publié le

How to start with git and GitHub

  • Sex in your area is here: ♥♥♥ http://bit.ly/36cXjBY ♥♥♥
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • Dating direct: ❶❶❶ http://bit.ly/36cXjBY ❶❶❶
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • Nice !! Download 100 % Free Ebooks, PPts, Study Notes, Novels, etc @ https://www.ThesisScientist.com
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici

Git & GitHub for Beginners

  1. 1. @ssaunier git & GitHub for Beginners
  2. 2. Knowledge worker We create and edit documents (text, images, etc.)
  3. 3. Everyday workflow 1. Create a file 2. Save it 3. Edit it 4. Save it again 5. etc.
  4. 4. File life
  5. 5. Manual version control
  6. 6. Can we automate this? For each document version, we need to know 1. When the file was modified 2. What changed 3. Why it was modified
  7. 7. There’s more, teams
  8. 8. Hence one more question For each document version, we need to know 1. When the file was modified 2. What changed 3. Why it was modified 4. Who did the change
  9. 9. In a nutshell We want a tool which 1. tracks document version 2. keeps an history of document changes 3. foster team work
  10. 10. Set up Download & install git at http://git-scm.com/
  11. 11. Your identity $ git config --global user.name "Sebastien Saunier” $ git config --global user.email "seb@lewagon.org"
  12. 12. Basic commands
  13. 13. Starting $ mkdir new_project $ cd new_project $ git init
  14. 14. Status $ git status git can tell you if your folder has some modified files (dirty)
  15. 15. Commit
  16. 16. 2-steps process # Select which file to add to the commit. $ git add <file_1_which_has_been_modified> $ git add <file_2_which_has_been_modified> # Take a snapshot of what is in the staging area. $ git commit --message "A meaningful message about this change"
  17. 17. Diff If git status tells you something changed, you can inspect exactly what changed: $ git diff $ git diff <a_specific_file_or_folder>
  18. 18. Log Show commit history with $ git log
  19. 19. Branching
  20. 20. One feature = One branch
  21. 21. Branch $ git branch my-feature
  22. 22. Working in the Branch $ git checkout my-feature $ git commit (x2)
  23. 23. Merge $ git checkout master $ git diff master..my-feature $ git merge --no-ff my-feature
  24. 24. Clean up $ git branch -d my-feature
  25. 25. Start Over
  26. 26. Remote
  27. 27. We need a remote! Go to GitHub, create a repo: https://github.com/new $ git remote add origin https://github.com/<user>/<project>.git
  28. 28. Push Share the code with your team, and the world # Generic command $ git push <remote> <branch> # What we'll use $ git push origin master
  29. 29. Pull # Generic command $ git pull <remote> <branch> # What we'll use $ git pull origin master
  30. 30. Github Desktop app desktop.github.com
  31. 31. Profile page
  32. 32. Repository page
  33. 33. Commits & Branches
  34. 34. Pull requests
  35. 35. Issues
  36. 36. Forks Open source contribution
  37. 37. Github pages Hosting your website for free! Repo example: lewagon/ui-components
  38. 38. Thank you!

×