Page History

Turn Off History

Checklist of things to do before running "git push"

  1. View and examine the commits to push:
     git log origin/<branch>..<branch> 
    1. Check to see if you should combine multiple commits
      • You should definitely combine if:
        • Any of the commits "checkpoints"
        • Any of the commits "fix previous commit"
      • You should consider combining if:
        • Any of the commits is a partial implementation
        • Two or more of the commits could be considered to be a logical group
      • See Squashing git commits for details on how to do this

    2. Verify that any commits that are related to a GitTrac ticket have the ticket number in the commit comment. Examples:
      • Fix bug that caused the foo daemon to crash when bar happens [#123]
      • Implemented #234 to allow the user to do something really cool
      • Fixed bug (#345) that caused bad things to happen

      1. If you know git well enough, you can change the last -- only the last -- commit message via:
        • git commit --amend
        • Note: If you're not familiar with git, use the below method.
        • Note: This seems to do strange things if you've run 'git add' since the commit.

      2. It's easy and safer to edit the commit message in GitTrac after you do the push.
        • Sind the relevant commit in GitTrac
        • Edit the commit message to include the ticket number as above, then save your changes.
        • Note: GitTrac edits to git commit messages do not affect the actual git repository -- if you run "git log", you'll see your original commit message, but GitTrac will use the edited message.