How to commit changes after build

Hello. I wiant than bamboo commit changes after build. So I add script file like this:

'git commit -a -m "${bamboo.buildKey} ${bamboo.buildNumber}"

git push origin development'


But iot's not do it. Error is [detached HEAD 8943e60] So. This is simply question. How can i commit changes in bamboo task script job?

4 answers

That sounds like generally bad practice - what changes are you making to your source within your build that you want to commit back into source control?

It's not bad practice. Release version and build number.

Ok.  In the actual source?  Usually I've seen that as just tags, but I can see the use case for wanting it to be in the source as well.

I wrote a guide to tagging a commit and pushing it back to BitBucket.  I'll page a link as an answer - I think it should be easily adaptable to your situation.

I wrote this guide specifically for tagging a commit and pushing back to Stash (BitBucket), but it should be easily adaptable.

It's surprisingly not as simple as you'd think, as far as I've been able to figure out, because of the somewhat funky way that Bamboo does git and because the build may actually be running on an agent that doesn't share the SSH set up that the server itself uses.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Monday in Jira Ops

Jira Ops Early Access Program Update #1: Announcing our next feature and a new integration

Thanks for signing up for Jira Ops! I’m Matt Ryall, leader for the Jira Ops product team at Atlassian. Since this is a brand new product, we’ll be delivering improvements quickly and sharing updates...

512 views 0 9
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