GIT from n00b BeerCamp+ Nov 9, 2011 Sang Dee Gallery
Introduction my self $whois @amaudy
Introduction my self $whois @amaudy Just web programmer
Introduction my self $whois @amaudy Just web programmer (PHP, jQuery, Drupal/Wordpress, Rails)
What is GIT? GIT is an  Open source  distributed version control
What is GIT? GIT is an   Open source   distributed version control
What is GIT? GIT is an  Open source  distributed   version control
What is GIT? GIT is an  Open source  distributed   version control
Distributed
Distributed Do everything (mostly) in local
Do everything in local - Commit (save what you did)
Do everything in local - Commit (save what you did) - View file or project history
Do everything in local - Commit (save what you did) - View file or project history - Switch to other branch
Do everything in local - Commit (save what you did) - View file or project history - Switch to other branch - Merge branches
What is Version Control? What is Version Control? History of your Project
What is Version Control? What is Version Control? History of your Project - Features
What is Version Control? What is Version Control? History of your Project - Features - Bug fixed
What is Version Control? What is Version Control? History of your Project - Features - Bug fixed - Experiment your idea
Benefit of Version Control
Benefit of Version Control - Collaboration
Benefit of Version Control - Collaboration - Programmer&Designer
Benefit of Version Control - Collaboration - Programmer&Designer - Programmer&Programmer
Benefit of Version Control - Collaboration - Programmer&Designer - Programmer&Programmer - Track your work
Problem before not use GIT
Problem before not use GIT - Nobody know who modified files
Problem before not use GIT - Nobody know who modified files - Nobody know who add/delete files
Problem before not use GIT - Nobody know who modified files - Nobody know who add/delete files - Project manager of team m...
Problem before not use GIT - Nobody know who modified files - Nobody know who add/delete files - Project manager of team m...
What I like on GIT? - Fast
What I like on GIT? - Fast - No server (commit, diff, branch)
What I like on GIT? - Fast - No server (commit, diff, branch) - Easy to use
What I like on GIT? - Fast - No server (commit, diff, branch) - Easy to use - Many choice of GUI client
Get start on GIT
Installation Ubuntu sudo apt-get install git-core
Installation Ubuntu sudo apt-get install git-core Mac Use .dmg file
Installation Ubuntu sudo apt-get install git-core Mac Use .dmg file Windows msysgit
Configuration
Configuration git config –global user.name “your name”
Configuration git config –global user.name “your name” git config –global user.email “foo@bar.com”
Configuration git config –global user.name “your name” git config –global user.email “foo@bar.com” git config –global colo...
Get repository Create on local git init
Get repository git clone https://github.com/twitter/bootstrap.git Create on local Clone from remote machine git init
Add files/directory
Add files/directory git add .
Add files/directory git add . git add somefile.php
Add files/directory git add . git add somefile.php git add *.js *.css
Commit your work git commit -m 'I just did something cool'
View history git log
GIT Branches
GIT Branches - Do something different in project
GIT Branches - Do something different in project - Separate from original code
GIT Branches - Do something different in project - Separate from original code master
GIT Branches - Do something new for different - Separate from original code master development
GIT Branches - Do something new for different - Separate from original code master development theme2
Create branch git branch development
Create branch git branch development git checkout -b development
Create branch git branch development git checkout -b development /* development = name of branch */
Switch between branch git checkout development
Switch between branch git checkout development git checkout master
My work flow mkdir projectx
My work flow mkdir projectx cd projectx
My work flow mkdir projectx cd projectx git init
My work flow mkdir projectx cd projectx git init gedit .gitignore
My work flow mkdir projectx cd projectx git init gedit .gitignore git add .
My work flow mkdir projectx cd projectx git init gedit .gitignore git add . git commit -m 'start Project X'
Collaborate with team
Collaborate with team git add origin git@host.com:path/to/repository.git
Your co-worker flow git clone git@host.com:path/to/repository.git gedit index.php git add index.php git commit -m 'add ind...
My work flow git fetch git checkout master git merge origin/master
Demo
Spread BeerCamp - Tweet - Facebook - Blog - Invite your colleague
Upcoming SlideShare
Loading in …5
×

GIT from n00b

636 views

Published on

Basic of GIT from novice.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
636
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

GIT from n00b

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

×