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