git from n00b

Download GIT from n00b

If you can't read please download the document

Upload: supachai-vorrasing

Post on 25-May-2015

464 views

Category:

Technology


0 download

DESCRIPTION

Basic of GIT from novice.

TRANSCRIPT

  • 1. GIT from n00b BeerCamp+ Nov 9, 2011 Sang Dee Gallery

2. Introduction my self $whois @amaudy 3. Introduction my self $whois @amaudy Just web programmer 4. Introduction my self $whois @amaudy Just web programmer (PHP, jQuery, Drupal/Wordpress, Rails) 5. What is GIT? GIT is anOpen sourcedistributed version control 6. What is GIT? GIT is an Open source distributed version control 7. What is GIT? GIT is anOpen sourcedistributed version control 8. What is GIT? GIT is anOpen sourcedistributed version control 9. Distributed 10. Distributed Do everything (mostly) in local 11. Do everything in local - Commit (save what you did) 12. Do everything in local - Commit (save what you did) - View file or project history 13. Do everything in local - Commit (save what you did) - View file or project history - Switch to other branch 14. Do everything in local - Commit (save what you did) - View file or project history - Switch to other branch - Merge branches 15. What is Version Control? What is Version Control? History of your Project 16. What is Version Control? What is Version Control? History of your Project - Features 17. What is Version Control? What is Version Control? History of your Project - Features - Bug fixed 18. What is Version Control? What is Version Control? History of your Project - Features - Bug fixed - Experiment your idea 19. Benefit of Version Control 20. Benefit of Version Control - Collaboration 21. Benefit of Version Control - Collaboration - Programmer&Designer 22. Benefit of Version Control - Collaboration - Programmer&Designer - Programmer&Programmer 23. Benefit of Version Control - Collaboration - Programmer&Designer - Programmer&Programmer - Track your work 24. Problem before not use GIT 25. Problem before not use GIT - Nobody know who modified files 26. Problem before not use GIT - Nobody know who modified files - Nobody know who add/delete files 27. Problem before not use GIT - Nobody know who modified files - Nobody know who add/delete files - Project manager of team membersdon't know what you do in code 28. Problem before not use GIT - Nobody know who modified files - Nobody know who add/delete files - Project manager of team membersdon't know what you do in code - Nobody know who to blame when something went wrong 29. What I like on GIT? - Fast 30. What I like on GIT? - Fast - No server (commit, diff, branch) 31. What I like on GIT? - Fast - No server (commit, diff, branch) - Easy to use 32. What I like on GIT? - Fast - No server (commit, diff, branch) - Easy to use - Many choice of GUI client 33. Get start on GIT 34. Installation Ubuntu sudo apt-get install git-core 35. Installation Ubuntu sudo apt-get install git-core Mac Use .dmg file 36. Installation Ubuntu sudo apt-get install git-core Mac Use .dmg file Windows msysgit 37. Configuration 38. Configuration git config global user.name your name 39. Configuration git config global user.name your name git config global user.email [email protected] 40. Configuration git config global user.name your name git config global user.email [email protected] git config global colour.ui auto git config list 41. Get repository Create on local git init 42. Get repository git clone https://github.com/twitter/bootstrap.git Create on local Clone from remote machine git init 43. Add files/directory 44. Add files/directory git add . 45. Add files/directory git add . git add somefile.php 46. Add files/directory git add . git add somefile.php git add *.js *.css 47. Commit your work git commit -m 'I just did something cool' 48. View history git log 49. GIT Branches 50. GIT Branches - Do something different in project 51. GIT Branches - Do something different in project - Separate from original code 52. GIT Branches - Do something different in project - Separate from original code master 53. GIT Branches - Do something new for different - Separate from original code master development 54. GIT Branches - Do something new for different - Separate from original code master development theme2 55. Create branch git branch development 56. Create branch git branch development git checkout -b development 57. Create branch git branch development git checkout -b development /* development = name of branch */ 58. Switch between branch git checkout development 59. Switch between branch git checkout development git checkout master 60. My work flow mkdir projectx 61. My work flow mkdir projectx cd projectx 62. My work flow mkdir projectx cd projectx git init 63. My work flow mkdir projectx cd projectx git init gedit .gitignore 64. My work flow mkdir projectx cd projectx git init gedit .gitignore git add . 65. My work flow mkdir projectx cd projectx git init gedit .gitignore git add . git commit -m 'start Project X' 66. Collaborate with team 67. Collaborate with team git add origin [email protected]:path/to/repository.git 68. Your co-worker flow git clone [email protected]:path/to/repository.git gedit index.php git add index.php git commit -m 'add index.php' git push origin master 69. My work flow git fetch git checkout master git merge origin/master 70. Demo 71. Spread BeerCamp - Tweet - Facebook - Blog - Invite your colleague