12

I am using a centralized git workflow where there is a central repo on a Windows server and we have working directories on development machines. Everything was going fine until I all of the sudden started getting errors when pushing to the remote repo. This is the error:

remote: fatal: failed to write object
fatal: sha1 file '<stdout>' write error: Broken Pipe
error: failed to push some refs to 'my_central_repo'

I can't figure out what happened but I need to push my project to the central repo, any help would be greatly appreciated.

3
  • I have tried it about 100 times lol. I restarted my machine and everything. Unfortunately I don't believe it is that simple. Commented Apr 26, 2016 at 20:30
  • 1
    Do you manage git server ? Do you have enough disk space ? Correct file/directory permission ? Commented Apr 26, 2016 at 20:37
  • Did You try this? blog.lukebennett.com/2011/07/25/… Commented Apr 26, 2016 at 20:59

6 Answers 6

9

This may also be due to owner permissions issue on your remote git repo directory. It also happens when creating the directory as root.

If you do

# ls -al <repo-name>.git

and see

drwxr-xr-x .. .. root root .. .. <repo-name>.git

then that may the the source of the issue, you are trying to push to the repo with a non-root account.

Which can be easily resolved by:

# chown -R git:git <repo-name>.git ; ls -al
drwxr-xr-x .. .. git git .. .. <repo-name>.git

and then enjoy a successful git push

Sign up to request clarification or add additional context in comments.

Comments

5

While troubleshooting the problem, I found this article explaining the root cause but, in my case it was slow network that was causing this problem. Once I moved to the faster network, push went through. May be something has to do with timeout.

Comments

1

In my case was truing to push first commit to remote bitbucket repository. The error appeared after cmd:

git push -u origin master

The problem got resolved by removing the "-u" flag

Comments

0

I am still trying to figure out the root cause, but as suspected it was a permissions related error. When I mapped the network drive to the directory where my central repo exists using the Admin account for my GitServer it resolved the issue.

The strange thing is, I was previously pushing to my GitServer repo not problem with the network drive mapped with my personal credentials so I am not sure what happened that changed the permissions on my repo for my user. No other users using other central repos experienced this issue.

Comments

0

Try changing the remote URL from https to git

git remote set-url origin [email protected]:username/reponame.git

Comments

-2

Unless it's a permission problem with the git server (do you have admin rights?), it might be that there are some new pushes since you last pulled. Try:

git pull --rebase origin master
git push origin master

1 Comment

I do believe it is permission related but I am not sure hot to resolve it. Its weird because the user I am logged in as was pushing fine...then all of the sudden I was just no longer able to. How do I ensure I have admin rights?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.