Skip to main content

Git commit workflow

Current process of committing to the general and projects repositories:

  • cd to the desired repository.
  • git pull
  • Make changes to the repository.
  • git add the files you want to commit.
  • git commit -m "Message that you want to write."
  • git push

Git development standards

  • master/main branch is the live version, it\'s published directly from the repository

  • dev branch will act as a \"test\" or \"staging\" branch, where all content in development will ultimately pass through before being published

  • I sometimes develop straight on the dev branch, but I would prefer not to. Sometimes I just forget.

  • We will create feature branches for either specific tickets or groupings of tickets.

  • When a feature is complete, a PR is created to merge the feature branch into dev

  • When the PR is completed, the branch will be deleted

  • After testing on dev, we will PR dev into master with a tagged release version

    • Sometimes if changes are small, I don\'t increment versions

For React apps, anyone can perform the version bump and tag:

  • git checkout dev

  • yarn release (major|minor|patch)

  • Create and merge PR

  • yarn post-merge

For example, this morning I completed a ticket to \"fix the cesium map\" page, but we had decided to remove it instead. This was my workflow:

  1. git checkout dev

  2. git pull

  3. git checkout -b remove-cesium

  4. git push --set-upstream origin remove-cesium

  5. Perform development.

  6. Commit working code

  7. yarn release patch

  8. Open GitHub and create PR from remove-cesium into master (ideally I should have done into dev, but I didn\'t need to perform testing, and new PR\'s go to master by default). Assure version number, i.e. v1.7.7 is the first part of the PR (if it has a version number available)

  9. Merge the PR and delete the branch

  10. git checkout master

  11. git pull

  12. yarn post-merge

  13. git checkout dev

  14. git merge master

  15. git push

  16. git branch -D remove-cesium