Tracking GIT commit on issue

I've just started using Bitbucket. I was wondering if there's a way to keep track of all commits pertaining to a particular issue. If this possible using Bitbucket, how?

2 answers

1 accepted

First you need to decide if you want to use Mercurial or Git. They are both Bitbucket supported DVCSes and thus have similar high-level usage patterns but the details are naturally (very) different.

With both tools the way to group commits is to use branches. Branching with Git is very well explained in http://git-scm.com/book/en/Git-Branching-What-a-Branch-IsIf you choose Git as DVCS to use with Bitbucket I recommend you read the book from cover to coder. I'm not familiar enough with Mercurial to tell you the authorative Mercurial text - Google will find a lot of material (including http://hginit.com/).

So if I wanted to view all commits related to the issue when I view that issue via Bitbucket, all I need to do is create a branch. Is there a naming convention I should follow?

There is no branch naming convention enforced by Bitbucket/Git, but naturally you should have a convention so that it's easy for humans to find issue related branches. Bitbucket also seems to have a word about branch workflows: https://confluence.atlassian.com/display/BITBUCKET/Using+Git+branches

I really recommend you to start with http://git-scm.com/book/en/(or similar for Mercurial). DVCSes are versatile powertools that require an initial effort.

I undestand now. So bascially inorder for me to see all commits related to an issue whenever I view that issue via Bitbucket the procedure below solves it:

  1. Create an issue
  2. Create a branch
  3. Git commit to that branch
  4. View the issue on Bitbucket
  5. All GIT commits are viewed as issue comments

Please correct me if I'm wrong.

Points #1-#3 seems to be correct but I'm not sure what you mean with points #4-#5. I'm afraid you don't have yet good enough understanding about Bitbucket and Git and Bitbucket's limited issue handling capabilities.

Or do you mean "Including Issues in a Commit Message":

https://confluence.atlassian.com/display/BITBUCKET/Resolve+issues+automatically+when+users+push+code

Now when your commit message includes a string: "see issue #34" the commit will be linked to the issue.

You can just create a test repo and trial the workflow there.

Anyway I think you're now on the right track. Hope this helped you !

Actually that link got me stuck for days, since I have a little knowledge how Mercurial works. I was hoping for a GIT documentation for it.

I am curious about the limited capabilities of Bitbucket regarding issue handling. So you mean even if I make a git commit like this syntax:

git commit -m "<Issue#> <IssueStatus> <GIT message>"

That commit will never be seen as a comment on that issue I pertained in into?

I believe Bitbucket will parse those comments the same way for both Git and Hg.

Also, it appears that the issue number alone is not sufficient, and "<Issue#> <IssueStatus>" is not the expected syntax either.

According to the article Jani H linked to, you should use "<command> <issue id>", with the list of available commands (along with the issue tracker's responses) listed in the table near the end of the article.

Points #1-#3 seems to be correct but I'm not sure what you mean with points #4-#5. I'm afraid you don't have yet good enough understanding about Bitbucket and Git and Bitbucket's limited issue handling capabilities.

Or do you mean mean "Including Issues in a Commit Message":

https://confluence.atlassian.com/display/BITBUCKET/Resolve+issues+automatically+when+users+push+code

Now when your commit message includes a string: "see issue #34" the commit will be linked to the issue.

You can just create a test repo and trial the workflow there.

Anyway I think you're now on the right track. Hope this helped you !

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

716 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot