Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to make git commands in a script task

Vcabourdin January 29, 2013

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
Answer accepted
Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 29, 2013

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?

Vcabourdin January 29, 2013

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

Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 29, 2013

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

Vcabourdin January 29, 2013

When you say build you mean the whole plan ?

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

Vcabourdin January 29, 2013

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
TAGS
AUG Leaders

Atlassian Community Events