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

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

99 views 1 0
Join discussion

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