git push to remote repository


I am cloning the stash repository using Bamboo and then adding one file , committing it to push. I am not able to push the code to remote repository where as it is pushing to local repository only.

 D:\Apps\Atlassian\Data\Bamboo\xml-data\build-dir\IRIS-IRGIT-JOB1>D:\GIT\Git\cmd\git.exe push origin develop
23-Jan-2017 15:27:59To file://D:\Apps\Atlassian\Data\Bamboo\xml-data\build-dir\_git-repositories-cache\7f363ec58eaf0b8a31de372c238909c1f8510801
23-Jan-2017 15:27:59   eeca324..fecb2d3  develop -> develop


Here is the code that I have in script job


echo "create the file"
echo "${bamboo.version}.${bamboo.major}.${bamboo.minor}" >> file1.txt
D:\GIT\Git\cmd\git.exe add file1.txt
D:\GIT\Git\cmd\git.exe commit -m "adding a file"
D:\GIT\Git\cmd\git.exe remote add origin ssh://git@gitserver:7999/test/test_src.git
D:\GIT\Git\cmd\git.exe push origin develop


Can any one please guide me how I can push that to remote repo.


Thanks for help in advance.

1 answer

0 votes

Hello Omprakash,

When using Bitbucket server (former Stash) as repository type in Bamboo, Bamboo create a SSH keypair and this is the way Bamboo communicates with Bitbucket server when running Source Code Checkout task. When running the Source Code Checkout task, Bamboo creates the .git under the build working directory and this does not have reference to the actual repository in Bitbucket server (Bamboo uses a git cache instead), so you are not able to push against your repository.

Please, I would suggest you on referring to for further information.

Kind regards,


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Thursday in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables ROLLBAR_ACCESS_TOKEN...

194 views 0 12
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