0

I am getting the error failed to push some refs, below

$ git push origin bob Total 0 (delta 0), reused 0 (delta 0) To git:/var/git/webservices.git * [new branch] bob -> bob error: failed to push some refs to 'git:/var/git/webservices.git' 

Note: this has nothing to do with non-fast-forward pushes.

To try and rule it out I have set 777 permissions to the whole remote repo.

Any idea how to find what ref it can't push?

(to be clear it has pushed the new branch to the repo and this is a repo that was previously working fine)

7
  • 1
    I'd wager it's the first it tries, for a reason as simple as insufficient permissions on target repository. Commented Sep 23, 2013 at 14:48
  • you could also try doing a local push (both on your client machine and on the server) instead of using ssh Commented Sep 23, 2013 at 14:55
  • Second chance: disk full or quota exceeded? Commented Sep 23, 2013 at 15:02
  • plenty of space on all mounts, and other repos on the same box working fine Commented Sep 23, 2013 at 15:06
  • 1
    You only pushed one ref, bob. The weird thing is that it looks like it succeeded, and then it says it failed after all (?!). If you log in to the server, is the ref there? (cd to the bare repo and run git rev-parse bob to see.) Commented Sep 23, 2013 at 18:35

1 Answer 1

2

Our problem was that setting 777 permissions to the repo added execute permissions and activated the sample hooks!

When this repo was created they did not use to have the .sample on the end. Very dangerous. :(

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

2 Comments

Setting chmod 0777 on everything is always very dangerous. Unless you know exactly that you want the files to be executable, don’t give them 0777 but 0666 instead. But in general, to not make executable files un-executable by accident, use chmod a+rw instead.
I agree, I only resorted to that because a+rw did not solve our original permissions problem that led to this one.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.