I configured the following command in Jenkins to push change on gitA to gitB repository. However I got the following error:
error: src refspec ... does not match any. error: failed to push some refs to ...
+ /usr/local/bin/git remote rename origin upstream
+ /usr/local/bin/git remote add origin ssh:<gitB repo>
+ /usr/local/bin/git fetch origin
* [new branch] master -> origin/master
+ /usr/local/bin/git push origin master
error: src refspec master does not match any.
error: failed to push some refs to 'ssh://<git repo>
Build step 'Execute shell' marked build as failure
Finished: FAILURE
However, I tried to git push origin origin/master and the Jenkins job execution is successful but no commit on the destination repo.
I have added ssh key. Please suggest what is missing here. I also tried to see the source branch using git branch and it's correct.