Skip to content

Instantly share code, notes, and snippets.

@acoravos
Created December 27, 2016 07:00
Show Gist options
  • Save acoravos/4d011a3f6128260c2c57d37f8dc6a362 to your computer and use it in GitHub Desktop.
Save acoravos/4d011a3f6128260c2c57d37f8dc6a362 to your computer and use it in GitHub Desktop.
Git-Sample-Workflow

Sample Workflow

  • Name the branch after the feature you're creating: git checkout -b "your-initials/name-of-feature" (you will need the quotes when you create a new branch name)

  • Code your feature

  • Check the status of your changes: git status

  • Add the feature updates: git add --patch

  • Then go back to the master branch: git checkout master

  • Pull down all changes from master: git pull origin master. This is an important step! This makes sure you are handling all (if any) merge conflicts on your computer

  • Merge the master branch with your feature branch: git checkout your-initials/name-of-feature and then merge your branch: git merge master your-initials/name-of-feature. If you have conflicts, you will see an alert. Resolve the conflicts.

  • Then push up your feature branch: git push origin your-initials/name-of-feature. Note: never type git push origin master. Don't be that person who pushes to master :)

  • Create a pull request on GitHub. Ask a teammate to approve your request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment