stash: feature workflow using branches uncertainty


we just started using jira/stash/bamboo for a small project. One thing we are not completely certain about is the feature workflow using branches.

For a new feature we do the following

  • create a feature issue
  • from jira, create a branch
  • in intellij idea, we checkout that branch as a new local branch
  • code the feature
  • commit the feature
  • push the current branch to origin

But, what happens now

  • do we merge locally to master and then push?
  • do we create a pull request and merge from there? do i then have to delete the feature branch locally too (sorry, new to git)? also, is there a way around the feature request since we are 2 developers inside that project only, and each works on his own subprojects
  • if that feature is merged (by a pull request, or manually?), is the state in JIRA automatically changed?

Is there somewhere some step by step explanation for how such workflows would usually work, or did i just not find that?


Best, Timm

2 answers

For the merge, these are the options:

  • create a pull request and merge it form the web interface
  • create a pull request and merge it by merging the branch in a git client (and pushing the merge)
  • do not create a pull request, just merge the branch in a git client (and push the merge)

In all cases above, it is up to you if you delete the feature branch afterwards, but you probably want to do that to keep the branch list manageable in the long run.

Not sure about the JIRA part, but I think it does change state automatically.


0 votes

Hi Timm,

This is a very good question and will help a lot of people.

There is no right and wrong workflow. You will need a mix of them all. Answering your question: yes, Atlassian wrote a very good guide on the workflows where you will be able to understand them and mix it up.

You will probably be interested in the Feature Branch Workflow. You will see that it is a good practice to utilise Pull Requests as it will generate discussion between people involved in the code review prior to the merge. As written on Merging a Pull Request, while creating a PR using Stash UI you are able to check Delete branch if you no longer need that branch in the repo. Stash will do that automatically for you once the Pull Request is merged.

Another advantage of using Pull Requests as part of your workflow, is that you can include Checks for merging Pull Requests. Stash will control those case scenarios. You could also install add-ons like the Stash Auto Unapprove plugin to return its status to unapproved in case someone push changes between the time it had been approved and the merge.

The choice for merging locally and pushing will obviously work, but it won't get all your developers involved and will bypass the features I just described - which add a lot of value to the code review and avoid merging "bad" code.

The state in JIRA is automatically changed when using Stash 3.2+ and JIRA 6.3.3+ together. This is described on our JIRA Integration document.

Let me know if that information helped you.

Best regards,
Thiago Bomfim
Atlassian Support - DevTools

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Thursday in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables ROLLBAR_ACCESS_TOKEN...

190 views 0 12
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