Domanda

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

È stato utile?

Soluzione

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.

Altri suggerimenti

First you should be aware of the difference between checkin and rcheckin (See git-tfs documentation for the commands for that ... It will really help!)

Then commit message are analysed to find workitems assocation only with rcheckin ( and not checkin) so 1) and 4) won't work.

2) The message is strange but that's because rcheckin is not supposed to work that way.

3) Just discovered today (what a coincidence!) that there is a bug in this synthax (that I never use!). Just use :

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

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

to pass through the bug...

But the error you get tell me that you have a bigger problem (not linked to workitem association) and that you missed something with git-tfs (but I don't see what :( )

For your information, I HIGHLY prefer using rcheckin than checkin command that produce a awfull history with a lot of merge.

rcheckin is simpler. Do all your git commit with associating workitems in your commit message using #12345 and when you are happy, fetch from tfs, rebase your work (or do a git tfs pull -r) and do :

git tfs rcheckin

All should be ok!

Also look at our use cases

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top