Guest User

Untitled

a guest
Mar 17th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. # Git Branch Cycle
  2.  
  3. Ready to tackle an issue? It's time to start working on branches
  4.  
  5. ## Step 1 - Make sure your master is up to date
  6.  
  7. ```
  8. git checkout master
  9. git pull
  10. ```
  11.  
  12. ## Step 2 - Check out a new branch
  13.  
  14. ```
  15. git checkout -b new-branch-name
  16. ```
  17.  
  18. ## Step 3 - Make changes and commit them frequently
  19.  
  20. ```
  21. git add .
  22. git commit -m 'step completed'
  23. ```
  24.  
  25. ## Step 4 - Is the story/issue complete? Check for changes to the master
  26. This step can be a little more complicated. First you want to make sure you have any changes from the remote master that may have happened since you began this branch:
  27. ```
  28. git checkout master
  29. git pull
  30. ```
  31. And then merge them into your branch
  32. ```
  33. git checkout new-branch-name
  34. git merge master
  35. ```
  36. And finally deal with any conflicts locally in your editor before you push your branch to github.
  37.  
  38. ## Step 5 - Now push your branch to the remote/github
  39.  
  40. ```
  41. git push -u origin new-branch-name
  42. ```
  43.  
  44. After your changes have been reviewed and merged:
  45.  
  46. ## Step 6 - Pull a fresh copy of master & delete branch
  47.  
  48. ```
  49. git checkout master
  50. git pull
  51. git branch -d new-branch_name
  52. ```
  53.  
  54. Now find a new issue or story and start again!
Add Comment
Please, Sign In to add comment