-
Notifications
You must be signed in to change notification settings - Fork 1
Git Flow
Jess Dieuique edited this page Oct 16, 2017
·
1 revision
git checkout master
git pull --rebase
git checkout -b feature-my-new-feature
- Make commits...
git checkout master
git pull --rebase
git checkout feature-my-new-feature
-
git rebase master
- Solve any conflicts, then
git rebase --continue
until done.
- Solve any conflicts, then
-
git log --oneline
- Copy the commit hash previous to your first commit on the feature.
- Squash your commits:
git rebase -i [paste commit hash]
- You'll see a list of your commits next to the word
pick
- Change all
pick
tos
except the top mostpick
- Save and exit the VIM editor.
- You'll see a list of your commits next to the word
- Create a commit message for your squashed commits
- Remove all lines not beginning with
#
. - Add a commit message at the top of the file (no
#
in front). - Save and exit the VIM editor.
- Remove all lines not beginning with
git push origin feature-my-new-feature
- Locate your feature branch in the Branches tab in your github repo.
- Click Create Pull Request and leave a short description of the feature you finished.
To update your pull request with changes, simply continue making commits in your feature branch.
Do not squash these new commits (Or, you'll end up with conflicts). Instead just push them to github as normal.
- When you branch has been merged, remove your local feature branch.
git checkout master
git pull --rebase origin master
If there are conflicts with master use the following command
git checkout . && git reset --hard origin/master
git checkout feature-my-new-feature
-
git rebase master
- Solve any conflicts, then
git rebase --continue
until done.
- Solve any conflicts, then
git push origin feature-my-new-feature
Happy Coding! ✌️