0

I have a shell script running on a Jenkins box in which I am cloning my repository via HTTP and trying to push some changes also via HTTP to a remote branch which already exists.

However I keep getting failed to push refs error and adding --verbose doesn't really tell me why the error is happening. I don't believe it is a user permission issue since the user I used to clone the repository has master permission in our internal gitlab repo.

+ git status
On branch npm_publish
Your branch is ahead of 'origin/npm_publish' by 1 commit.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean

//Grepping the remote branches to make sure npm_publish is there
+ grep npm_publish
+ git branch -a
* npm_publish
  remotes/origin/npm_publish
+ git pull
Already up-to-date.
+ git push -u origin npm_publish --verbose
Pushing to https://<username>:<password>!@<internal repository>/quality/test.git
error: failed to push some refs to 'https://<username>:<password>!@<internal repository>/quality/test.git'

UPDATE: so before this step I do an

npm install
npm install grunt-cli

before pushing if I do

rm -r node_modules

it pushes just fine. Why would installing npm modules

love
  • 1,000
  • 2
  • 16
  • 35
user3626708
  • 727
  • 2
  • 8
  • 24
  • Could you try to update your repo from the remote using `git pull`before to push. It seems your repo is not up tp date – Flows Jun 21 '16 at 11:27
  • @Flows It didn't do any difference. I updated my question with the git pull statement output – user3626708 Jun 21 '16 at 13:54

1 Answers1

0

I guess this is similar kind of issue which you are facing. See if could fit your need.

Push a tag to a remote repository

Regards.

Community
  • 1
  • 1
Maxx
  • 709
  • 5
  • 11
  • 22