2

Ok, I'm relatively new to git etc. I have a Rails app I duplicated as the base for a new app (which I suspect is where this issue stems from). I had no issues with git on the initial app. For the new app I have initialized a repo, all the local commits are going fine, and the repo exists at github, but when I try to push I get an error:

git-receive-pack not found: did you run git update-server-info on the server?

So far I've checked that git-receive-pack is in /usr/bin, and a I also tried running the command

user$ git push receive-pack=/usr/bin/git-receive-pack

I also tried to alter the .git/config file as per this question ( git-upload-pack: command not found, how to fix this correctly ) to explicitly reference the upload and receive packs. I've also tried running

ssh user@host echo \$PATH

to check what's in the remote non-login path, but I get a permission error (permission denied: publickey).

So, any other suggestions?

UPDATE: I usually don't use the actual git app, but remembered it was there so tried to push from it instead of the command line. The error was different "remote: repository not found". If I search for it in the app it says "This repository's location on disk has changed". Where would it have gone?

UPDATE 2: As per timoras' question below, I think I've now (unintentionally - I only vaguely know what I'm doing) switched from https to ssh. I now get a NEW error when I try to push:

$ git push -u origin master

Invalid command: '/usr/bin/git-receive-pack 'username/appname.git''

You appear to be using ssh to clone a git:// URL.

Make sure your core.gitProxy config option and the

GIT_PROXY_COMMAND environment variable are NOT set.

fatal: Could not read from remote repository

Please make sure you have the correct access rights and the repository exists.

Note that this is a NEW error, NOT the original.

Below is the output if I run '$ git config -e':

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = false

[remote "origin"]
url = git@github.com:username/appname.git
fetch = +refs/heads/*:refs/remotes/origin/*
uploadpack = /usr/bin/git-upload-pack
    receivepack = /usr/bin/git-receive-pack
[remote "heroku"]
url = git@heroku.com:appname.git
fetch = +refs/heads/*:refs/remotes/heroku/*
Community
  • 1
  • 1
grist
  • 103
  • 1
  • 9
  • How exactly did you duplicate the project? Did you make a copy of the folder? Did you clone from the initial local project? Did you clone from the initial GitHub project? How did you initiate a repo for the new project? – JJD Aug 11 '13 at 01:06
  • I clicked on "download zip file" button on Github. Then I just did 'git init' in the new directory locally. I had to create the github repo manually, as 'git remote add' didn't work. Wrong? – grist Aug 11 '13 at 02:06
  • Sounds okay to me. What is the error message you receive when you execute `git remote add`? – JJD Aug 11 '13 at 11:54
  • JJD I didn't get an error for remote add originally (now it says "remote origin already exists"). It's when I try "git push" that it gives an error. – grist Aug 12 '13 at 08:29
  • You can check the *remotes* configuration via `git config -e` or `git remote -v`. Please **add all errors** you experience to your question so everybody has all the information to help you. – JJD Aug 12 '13 at 09:08
  • JJD, thanks - I've added output of git config -e above. Is there anywhere else I should be looking for error information? – grist Aug 12 '13 at 09:43
  • I think you added wrong gtihub url – timoras Aug 12 '13 at 12:15
  • What's the deal with `receivepack = /usr/bin/git-receive-pack`? This is not the standard configuration. Did you manually add this? What's the purpose of it? Same for `uploadpack`. – JJD Aug 12 '13 at 15:02
  • timoras what should the url be, and how do I change it? JJD I didn't change the receive pack congifuration - how should it be set up and how do I do that? – grist Aug 12 '13 at 21:06

3 Answers3

1

Ok, so for other noobs out there struggling with similar issues, this ended up being quite a saga. I ended up using a variety of sources, including friendly github help desk people to figure out the following (Terminal commands are included for those that, like me, are new to all this):

  1. Xcode developer pack automatically installs a version of git. This version was installed in /usr/bin. You can check the location through the command: $ which git
  2. I had installed my own version of git when trying to update, which automatically goes to /usr/local. There was a version conflict between the two. Because of the disparity in location the uninstall.sh file from the git download pack did not actually uninstall previous versions.
  3. Removing Xcode developer pack completely freed up c. 7GB from my drive, and didn't cause any issues. It did not, however, solve the underlying problem and didn't even remove the old version of Git - I ended up having to remove those files through manual deletion.
  4. After removing the old Git version from /usr/bin, I reinitialized the repo ($ git init).
  5. I then re-set the git references through $ git remote set-url origin https://github.com/username/repo-name.git
  6. This allowed me to successfully push ($ git push -u origin master or $ git push), but there were strange merge conflicts, so I pulled from github ($ git pull origin master), resolved conflicts with vimdiff (a topic in itself - just use google) then pushed again.

Ta da! Apparently all fixed. The Github people also recommended creating a fresh clone to use in future work ($ git clone https://gitub.com/username/repo-name.git).

Thanks everyone for your input.

grist
  • 103
  • 1
  • 9
1

I got this error when I tried to push a change to a repository that I had just cloned and made a single change to. Turned out I just didn't have write access to the repository.

Doug Bergh
  • 153
  • 1
  • 12
0

It seems you are using remote git over http/webdav. Run/ask yor git administrators to run git update-server-info on server at git repo

Edit

I think you added wrong gtihub url.

Go to your github web. check your repo url (SSH clone URL) and excute on your local git repo: remote set-url origin <url from gtihub page>

timoras
  • 98
  • 11
  • Too old to run http dump protocol! Use smart http protocol now! – linquize Aug 11 '13 at 09:10
  • timoras, I did the unthinkable and contacted github help desk - will wait to see their response. – grist Aug 11 '13 at 09:34
  • SO are you using ssh or http protocol? – timoras Aug 11 '13 at 13:12
  • Mmmmmmm..... not sure? I think I accidentally reverted to ssh when I was blindly trying random solutions in a fog of frustration and rage. – grist Aug 12 '13 at 08:25
  • timoras, I did have the wrong url - capitalized vs. non-capitalized - but it didn't fix the issue. – grist Aug 12 '13 at 21:15
  • I give up, it seams that problem is with uploadpack. An i do not know what it is, but saw that a lot of people have problems with that. – timoras Aug 13 '13 at 02:59