1

I created jenkins job which creates new branch and then push it to remote repo. Script look like this:

 VERSION=0.1
if [ "$BRANCH_SELECTOR" == "master" ]; then
    git checkout -b release-$VERSION
    git push -u origin release-$VERSION
fi

Jenkins failes and there is a console output:

+ git checkout -b release-0.1
Gewechselt zu einem neuem Branch 'release-0.1'
+ git push -u origin release-0.1
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository

Whats wrong here ? I also mention that i tried

+ git push -u origin release-0.1

and

+ git push -u origin master:release-0.1

Still doesn't work.

user3528733
  • 1,259
  • 7
  • 20
  • 37
  • 1
    Apparently there is no remote configured with the name `origin`. What does `git remote -v` show? – 1615903 Feb 17 '16 at 09:16
  • There is: $ git remote -v origin ssh://git@xxx/ebpl/xxx.git (fetch) origin ssh://git@xxx/ebpl/xxx.git (push) – user3528733 Feb 17 '16 at 09:20
  • And you are executing that command on the same folder as jenkins? – 1615903 Feb 17 '16 at 09:44
  • In the Git configuration, if you click on "Advanced" you'll see a "Name" field. According to the documentation, if this is blank, then Jenkins will choose a unique name. However, in my experience this ends up being `origin`. But make sure that `origin` is entered anyway. If you check the start of the Jenkins build log, you can see which remote name is being used, e.g. after "Fetching changes from the remote Git repository". – Christopher Orr Feb 17 '16 at 13:29
  • It related to this question [enter link description here](http://stackoverflow.com/questions/15437719/git-push-error-origin-does-not-appear-to-be-a-git-repository) – t10508hn Feb 17 '16 at 15:09

0 Answers0