XP-Dev.com Documentation - User Gude - Commit Messages
To be able to link commits in your source control (repository) with various artifacts (bugs, stories, tasks), both the artifact and source control need to be in the same project
Linking Commits with Artifacts
- To link a commit change with an artifact, all you have to do is add the #<id> of the artifact in your commit message. The #<id> number of the artifact can be found in various places.

- For example, to link your change to task #3, all that is needed is to add #3 to your commit message.

- Change committed with the message #3 Center the main table.

- The commit change should be displayed under the Commits tab of your story or bug.

Performing Actions on Artifacts using Commit Messages
- There are two actions that are supported:
- Closing artifacts
To close an artifact, you need to specify the phrase {closes|close|closed|fixes|fix|fixed} #<id> somewhere in your commit message.
Examples: Move image to footer. Closes #29 or Fixed #40 – add a synchronised block - Adding hours to artifacts
To add hours to an artifact, you need to specify the phrase #<id> add <hours>h
Examples: Managed to get the form working again, #21 add 1.5h
- Closing artifacts
- You can combine the two above to close and add hours to artifacts simultaneously.
Examples: Use red for the background. Closes #49 add 0.3h will close artifact #49 and add 0.3 hours to it.
- In the example below, we’ll be fixing and adding hours to Bug #1

- Change comitted with the message corrected title. Closes #1 add 0.4h

- Bug #1 closed and 0.4 hours added to it:


Advanced Usage and Hints
- To link a change to a number of artifacts, just repeat the #<id> of the affected artifacts in the same commit message. For example, did some changes to #45 #22 #99 will add the commit message to artifacts #45, #22 and #99.
- You can close a number of artifacts by repeating the #<id> of the artifacts in a row. For example, Closes #45 #22 #99 will close artifacts #45, #22 and #99.
