2

I had a non-bare git repository. I wanted to create a bare repository in a server to which I have an SSH access and make it the origin of the older repository.

I first created a bare repository in a directory X in an NFS partition by git init --bare. Then I signified in the original repository the origin as git remote add origin myusername@myserver:X. (In fact, I tried with the wrong user name and tried to push it for a couple of times; I deleted the wrong specification by git remote rm origin.)

When I tried to push, I got an error:

 fatal: packfile name 'myserver' does not end with '.pack'

Why am I failing in pushing? What is a possible workaround?

Addendum: X is in full path.

Pteromys
  • 1,441
  • 2
  • 12
  • 29
  • 1
    Do you see X if you do a `ssh myusername@myserver ls`? – VonC Dec 15 '14 at 07:12
  • @VonC I do. (Thank you for your attention) – Pteromys Dec 15 '14 at 07:57
  • And do you see the usual bare repo content in X? `branches/`, `config`, `info/`, `logs/`, `refs/`, ... – VonC Dec 15 '14 at 08:05
  • Just in case that has any effect, could you try and do a `git init --bare X.Git`, and change the remote to point to that new bare repo `X.git` (`git remote set-url origin myusername@myserver:X.git`) – VonC Dec 15 '14 at 18:20
  • @VonC Do you mean that the name of the repository matters? My `X` already ends in `.git`. – Pteromys Dec 15 '14 at 18:26
  • Ok, I thought it didn't use the `.git` extension yet. Can you clone that existing bare git repo? – VonC Dec 15 '14 at 18:38
  • @VonC Yes, I can, but I get an empty directory with a message `warning: You appear to have cloned an empty repository.` – Pteromys Dec 15 '14 at 18:40
  • That is expected. From that clone, can you just make a commit (create a new file, add and commit), for test, and push it back? – VonC Dec 15 '14 at 18:42
  • @VonC I can do that. Besides, if you clone the repo somewhere else, you can see the content just added. – Pteromys Dec 15 '14 at 18:46
  • 1
    So the issue might not be from the remote bare git repo, but from the existing content of the local repo you are trying to push... – VonC Dec 15 '14 at 18:47
  • Running on the idea of a corrupt local repository, maybe try running `git fsck` to see if the local repository has missing or corrupt data? – Hargo Dec 25 '14 at 08:56
  • @Hargobind Thank you for your suggestion; however, `git fsck` finishes w/o errors. – Pteromys Dec 25 '14 at 13:33

0 Answers0