Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Creating your own branchs

Creating and working with branches in Git

  1. Create a branch with git branch [your_branch_name]
  2. Checkout the branch with git checkout [your_branch_name]
  3. Publish your branch with git push origin [your_branch_name]
  4. Do some work, commit your changes
  5. When your branch is done, checkout master with git checkout master
  6. Pull down any changes from master with git pull
  7. Checkout your branch again and make sure it is up to date with master using git merge master
  8. If there are any conflicts, fix them. If not, you may need to exit the Vim text editor using :wq
  9. Push your changes up to Github with git push origin [your_branch_name]
  10. Create a pull request by clicking the green pull request button in Github
  11. Describe your pull request and wait for approval from the repo owner.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment