git clone --bare: fatal: repository does not exist

2019-01-25 10:08发布

问题:

I am using git version 1.7.10.4 on debian Wheezy.

I am trying to create a new repository (according to the 'manual of git-scm.com) However everytime I get this fatal error:

fatal: repository 'poekoe' does not exist

So this is what I type at command line:

git clone --bare --progress poekoe poekoe.git

I also tried this on a sqeeze distribution and there it works fine. (git version on squeeze is: git version 1.7.2.5)

All installed packages on the wheezy distribution are:

libcurl4-gnutls-dev
libexpat1-dev
gettext
vim
libz-dev
libssl-dev
git

all to get this working.

Does anybody know how to fix this? I am running the script as root

回答1:

git clone --bare --progress poekoe poekoe.git

That git clone only works if your current directory does contain the repo poekoe.

If your current folder is empty, then the error message makes sense.

The URLs section recommends using absolute paths:

$ git clone --bare -l /home/proj/.git /pub/scm/proj.git

The OP Bonifatiusk reports in the comments a solution depending on git version:

I found this:

git --bare init poekoe.git: this is indeed different from older versions who will init a new repo using --bare with clone.



回答2:

Sharing for future readers...

One possibility can be access rights. Make sure that you have at least read access to your main repository which you're trying to interact with.

On web based git solutions such as Bucket and Hub, this issue is unlikely since access permissions is handled by them in many cases.



回答3:

you get this error(fatal: repository 'pekoe' does not exist) when you don't follow the steps properly in git.

step-1:: install git and config with command

git config --global user.name eg., mack09 git config --global email

step-2:: the go to Github website create a new repository step-3:: copy the address from right-hand side https://github.com/mack09/repo.git

step-4:: go to git bash or cmd , create a folder to store all your project do go to the folder you created and now you are in created folder. step-5:: do this git clone https://github.com/mack09/repo.git step-6:: add heart.txt and git commit-m " message" and git push origin master. I tried this step it worked so try it and reply whatever the result.



标签: git debian