tfschangesetworkitemgit-tfsassociate

Associate changesets with work item git-tfs


I've tried figuring this out but with no success so far. I am using git-tfs to check in my changes to TFS (local using GIT repository)

I read this question which briefly describes that you can associate workitems in a commit message using metadata ( TF26198 error when doing git tfs rcheckin ) . Commands I've tried using:

1)

git tfs checkin -m "Changes to workitem #12345" => doesn't associate changeset to TFS workitem

2)

git tfs rcheckin -w12345 -m "Changes to workitem 12345" => triggers error "error: This syntax with one parameter is only allowed in bare repository." 

3)

git tfs checkin -w12345 -m "Changes to workitem 12345" => triggers error No TFS parents found

4)

git tfs checkin -m "Changes to workitem #12345" => doesn't associate work item

Any ideas on what I'm doing wrong?

Thanks, Iulia


Solution

  • Try adding :a behind -w12345 like this:

    git tfs rcheckin -w12345:a -m "Changes to workitem 12345"
    

    or

    git tfs checkin -w12345:a -m "Changes to workitem 12345"
    

    You can also use :r instead of :a to "resolve" instead of "associate"

    I think it's supposed to default to :a if you don't specify a value, but that never worked for me.