How to link a work load item with a commited chang

2019-07-10 04:36发布

I am working with Git for Visual Studio Online

  1. I added a Product Back Log item.
  2. I added some files & commited the change. (It did not linked for some reason)
  3. I made some more commits to the project & synced.

My 1st change was not linked with the Back log item & it still shows as pending under tasks.

How do I link the work item with my first commit?

1条回答
Melony?
2楼-- · 2019-07-10 05:33

Normally to link a commit to a work item you just reference the work item number in the commit message, for example git commit -am "related to PBI #1234". If it didn't work, you may have made a typo in the commit message.

Now, given you have already pushed your changes, amending your earlier comment to change the message would require an interactive rebase and pushing the result of that would be a bad thing (I'm assuming the repo is shared).

What you can do instead is go to the work item and under the Links tab, click the Link To... icon to add a new link. Select 'Commit' and then enter the SHA1 of the commit you want to link to.

enter image description here

Don't worry if you don't know the SHA1. Just use the ... button to browse your history and select the commit you're interested in.

查看更多
登录 后发表回答