-
Checkout develop:
git checkout developgit 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 developgit rebase origin/develop- or -
git checkout developgit pullgit checkout branches/branch-namegit rebase develop
-
Optional: Perform an interactive rebase (squash) your commits before pushing the branch:
git fetch origin developgit rebase -i origin/develop
-
Review and validate, push your changes upstream to origin:
git push -u origin branches/branch-name
git checkout developgit pullgit pull origin branches/branch-namegit push
-
git checkout master -
git pull -
git pull origin developgit 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 mastergit 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 mastergit 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 mastergit merge --no-ff hotfix-branch-name
-
Back-merge your changes with development
git checkout developgit merge --no-ff hotfix-branch-name
-
Push your changes upstream
git push origin mastergit push origin develop