Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Git Branch Cycle
- Ready to tackle an issue? It's time to start working on branches
- ## Step 1 - Make sure your master is up to date
- ```
- git checkout master
- git pull
- ```
- ## Step 2 - Check out a new branch
- ```
- git checkout -b new-branch-name
- ```
- ## Step 3 - Make changes and commit them frequently
- ```
- git add .
- git commit -m 'step completed'
- ```
- ## Step 4 - Is the story/issue complete? Check for changes to the master
- 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:
- ```
- git checkout master
- git pull
- ```
- And then merge them into your branch
- ```
- git checkout new-branch-name
- git merge master
- ```
- And finally deal with any conflicts locally in your editor before you push your branch to github.
- ## Step 5 - Now push your branch to the remote/github
- ```
- git push -u origin new-branch-name
- ```
- After your changes have been reviewed and merged:
- ## Step 6 - Pull a fresh copy of master & delete branch
- ```
- git checkout master
- git pull
- git branch -d new-branch_name
- ```
- Now find a new issue or story and start again!
Add Comment
Please, Sign In to add comment