My Git Workflow
This post is mostly meant as a reference to myself for future contributions to my projects. The following is meant for a feature-based git workflow using branches.
Create a new feature branch:
Work on branch, & commit changes regularly:
Push remote branch regularly:
Checkout master, get upstream updates:
This last git pull --rebase
will get you all new branches. To only pull from master, type:
Checkout feature branch and rebase master:
Force push new git history to remote branch:
Go to GitHub and make a pull request:
- Switch to your branch on GitHub:
- Click the Compare & Review button:
- Review the PR changes and add a description of the PR
- Create the PR
Merge the PR on GitHub
Once you and your colleages are happy with the feature branch, you can merge it into your master branch.
You can merge the pull request through GitHub, by clicking the “merge pull request” button at the bottom of the pull request. This will only be available when GitHub predicts there won’t be any merge conflicts.
Delete Local Branch:
Delete upstream (remote) branch:
This option was added in Git v1.5.0, and is a more verbose alternative to: