Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Pushing Error

Tags:

git

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.

like image 622
mgrenier Avatar asked Apr 26 '16 20:04

mgrenier


1 Answers

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

like image 120
Jason Robinson Avatar answered Sep 30 '22 17:09

Jason Robinson