7
votes

we are using git in our on-premises TFS 2018 RC2 RTW

when we checkin our code we assiciate a work item by adding a hash and a number e.g. #8635

enter image description here

It is written in the docs that this should work with pull-requests. But in our case we do not neccessarly need pull-requests.

Is it possible to link commits with work items without pull-requests?

related:

Update:

I just tested this on a different git project on the same team project.

Guess what: It's working as expected. Strange there needs to be something with this git project...

enter image description here

2
As far as I know, this link works as soon as it is pushed to the TFS-repo. Your work item should have a link to the commit.Fabian H.
@FabianH.this is exactly what we would have expected. But this is not the case...Daniel
Have you tried this from Visual Studio? I see in your screen shot, you are doing this at the command line and I'm wondering if VS is doing something in the background which makes it work.tj-cappelletti
Yes. We also trief committing over Visual Studio. It does Not make a difference.Daniel
So if you go to the links tab of work item 8635 you don't see any associated commits?Pero P.

2 Answers

7
votes

Go to http://<yourTFSinstance>/tfs/<TeamProjectCollection>/<TeamProject>/_admin/_versioncontrol, then select the repo in question, and switch to the Options tab. Make sure the appropriate checkmark is ON:

enter image description here

0
votes

I've tested on my TFS 2018 RTM, and got correct behavior. You could try to upgrade your TFS 2018 RC2 to RTM version first.

And make sure after git commit -m command, you also git push the commit.

enter image description here