Git Push Checklist

Checklist of things to do before running "git push"

  1. View and examine the commits to push with 'git log'
     $ git log origin/<branch>..<branch> 
    1. Check to see if you should combine multiple commits
      • You should definitely combine if:
        • Any of the commits href="/wiki-archive/pages/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 all commit messages follow our conventions , esp that the gittrac 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
      • Note : Enclosing the ticket number in square brackets "[]" (i.e. "[#456]" ) will cause GitTrac to ignore it.

      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. You can edit commit messages that haven't been pushed using the same basic mechanism as Squashing git commits -- see Editing git commit messages for details.

      3. It's easy and safer to edit the commit message in GitTrac after you do the push.
        • Find the relevant commit in GitTrac , and click on the GitTrac commit ID (the 5-digit number in square brackets) hyperlink. We have a report that makes it easy to find all your recent commits 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.

      4. After the push, you can also associate the commit with the appropriate ticket(s) without editing the commit message.
        • Find the relevant commit in GitTrac and note the GitTrac commit ID (the 5-digit number in square brackets).
        • Edit the appropriate ticket, add the commit ID without the brackets to the field `Associated Check-ins', and apply your changes.

    3. Verify that all of the commits that you expect are present.

    4. Verify that there aren't unexpected commits or commits that are only 1/2 committed.

    5. Verify that the name and email address of the person doing the commit (probably you) is correct when you do a git log . It could show up as unknown if, for instance, you never told git your name and email address via git config .... did you do all the "Preliminary Setup" steps on this page ?

  2. Run 'git diff' and verify that the diffs are correct.

  3. If you added new files, did you
    1. put our Copyright notice at the top of the file?
    2. #include condor_common.h as the first include file (and if not, do you have a specific reason) ?

  4. Did you build and test your changes?