It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

With Stash Automatic Merge how can I avoid an automatic merge?

Gordon Waddell Mar 18, 2015

Automatic Merge is lovely.  But if I am using my release/ branches as support branches and doing release from them I will have a commit to up the version number (e.g. 2.1.1 on the release/2.1 branch) because of fix X.   So I have 2 commits - I want commit X (the fix) to auto merge down, and commit Y (the version number change) not to (because the other branches are not 2.1.1).

Any way to do this behavior?

1 answer

1 vote
Balazs Szakmary Mar 18, 2015

I would recommend that you read this, it gives a nice overview of how to deal with this sort of situation.

The short answer is that you need to:

  1. Commit Y
  2. Do a merge with the strategy "Ours" to mark Y as merged, but not actually merge it
  3. Commit X
  4. Let Stash do the auto-merges
Gordon Waddell Mar 19, 2015

This is pretty close to what I need but I think its going to be a more awkward dance. Using the simple Atlassian flow (not pure git-flow) I think it ends up like this: - I'm on release/v1.2 - I branch to bugfix/foo - I commit Y to bugfix/foo (where Y is e.g. a value change to 1.2.1) - I now have to manually merge bugfix/foo to release/v1.2 (taking the change) - manually merge to the next merge target (e.g. release/v1.3) using "ours" (so that the 1.2.1 is not taken) - return to bugfix/foo - do change X (which is the real bug fix) - use stash to merge bugfix/foo to release/v1.2 (where it will then also automerge to v1.3 and master) Is that right? Its a shame its such an interweave of command line merges and Stash merges.

Gordon Waddell Mar 19, 2015

(and there has to be some pushed mixed in there as some of the merges will be local and Stash works on the remote)

Adam Ahmed Atlassian Team Apr 19, 2015

You generally would only have to manually merge to 1.3 (with the "ours"). This won't catch the merge commit when it gets merged to 1.2 automatically, but assuming there are no conflicts, this'll be an empty commit anyway. I agree it's not ideal. I created https://jira.atlassian.com/browse/STASH-5356 to track ways we could support this in the UI.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

1,663 views 1 18
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you