How to make git commands in a script task

I try to make a simple git merge command in an inline script task.

This script task is executed just after a source code checkout task (on master).

This is my script task :

git merge develop

This is the error:

fatal: develop - not something we can merge

The 2 branches can be merged so I don't understand why I have this error

1 answer

1 accepted

1 vote

the local repository for your plan is created via

git init

git fetch

You probably need to fetch the branch to your repo first. Try executing your script task command manually in the plan build directory.

BTW. Is the branch integration feature not enough for your use case?

Maybe the branch integration feature can help me but I don't know how.

I have multiple jobs

  1. Tests: checkout develop branch and run unit tests
  2. If first job is ok
    1. merge develop on master (I don't know how)
    2. If possible I would like to tag and push the tags on origin
    3. some others things via scripts
  3. If previous job is ok I have other jobs to deploy but I know how to do it

Do you know any good tutorial or example on how to achieve that ?

I already read bamboo documentation and it's not clear enough for me

Thank you in advance

Please check if enabling Gatekeeper mode on that branch works for you then. It will merge with master only if the build is succesful.

Tagging will still not work unless you explicitely hook up your git checkout to repository

When you say build you mean the whole plan ?

develop branch will be merged to master only if the whole plan is successful ?

Ok, i managed to merge my branch with the gatekeeper mode but it seems the merge appens at the end of the plan. Is it true ?

Is it possible to launch the merge after a job or a stage ?

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,561 views 0 6
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