

Git Workflow Cheat Sheet
This is a cheat sheet for the Git workflow described in this tutorial: A Simple Project Management Workflow for Ionic Developers. For more information on setting up the workflow initially, please read that tutorial. This cheat sheet will only contain the commands needed for using this workflow after the initial set up.
Starting work on a new issue
- Checkout and update the
mainormasterbranch with the latest changes:
git checkout main
git pull- Create a new branch using the format
[your-initials]-[issue-number]or any consistent format you prefer:
git checkout -b jm-10- Send changes back to the remote branch referencing the relevant issue number in the commit message:
git add .
git commit -m "#10 added E2E test"
git push --set-upstream origin jm-10NOTE: --set-upstream origin branch-name is only required for the first push back to the remote repository
Finishing work on an issue
If the work is complete and does not require a refactor or review, use the closes syntax to automatically close the relevant issue and move it to the Done column in the Kanban board:
git add .
git commit -m "closes #10 finished the feature"
git pushMerging back into the main branch
- Make sure
mainormasteris up to date:
git checkout main
git pull- Merge changes from
maininto your branch:
git checkout jm-10
git merge mainNOTE: If there are conflicts (i.e. a change you have made collides with a change in main) you will see a message stating which files contain conflicts. You will need to open these files, resolve the conflicts, and then add/commit those files. Keep in mind that after running git merge you can run git merge --abort to undo that action.
- Merge the branch into
main:
git checkout main
git merge jm-10
git push(Optional) Remove the branch
git push origin --delete jm-10git branch -d jm-10