-
Checkout develop:
git checkout develop
git pull origin develop
-
Create a branch:
git checkout -b branches/branch-name
-
Do work:
git commit -m "Comment about the commit"
-
Rebase frequently to incorporate upstream changes:
git fetch origin develop
git rebase origin/develop
- or -
git checkout develop
git pull
git checkout branches/branch-name
git rebase develop
-
Optional: Perform an interactive rebase (squash) your commits before pushing the branch:
git fetch origin develop
git rebase -i origin/develop
-
Review and validate, push your changes upstream to origin:
git push -u origin branches/branch-name
git checkout develop
git pull
git pull origin branches/branch-name
git push
-
git checkout master
-
git pull
-
git pull origin develop
git push
-
Delete the Feature branch
- Local:
git branch -d branches/branch-name
- Remote:
git push origin --delete branches/branch-name
- Local:
-
Pull to update your local master branch:
git checkout master
git pull origin master
-
Check out a hotfix branch.
git checkout -b hotfix-branch-name
-
Do work in your hotfix branch, committing early and often:
git commit -m "Comment about the commit"
-
Interactive rebase (squash) your commits:
git fetch origin master
git rebase -i origin/master
-
Push your changes upstream, get code reviewed
git push -u origin hotfix-branch-name
-
Merge your changes with master
git checkout master
git merge --no-ff hotfix-branch-name
-
Back-merge your changes with development
git checkout develop
git merge --no-ff hotfix-branch-name
-
Push your changes upstream
git push origin master
git push origin develop