在服务器上正确创建git repo

在服务器上正确创建git repo,git,Git,我登录到我的服务器并使用以下命令创建了一个repo: mkdir project.git cd project.git git init --bare 然后在本地计算机上执行以下操作: git clone server@server:/path/to/repos/project 这似乎有效。但是,如果导航到该文件夹,则会在pull上出现错误,如: git pull Your configuration specifies to merge with the ref 'refs/heads/m

我登录到我的服务器并使用以下命令创建了一个repo:

mkdir project.git
cd project.git
git init --bare
然后在本地计算机上执行以下操作:

git clone server@server:/path/to/repos/project
这似乎有效。但是,如果导航到该文件夹,则会在
pull
上出现错误,如:

git pull
Your configuration specifies to merge with the ref 'refs/heads/master'
from the remote, but no such ref was fetched.


你实际上没有任何关于裸回购的信息。。。所以没有主分支。。。。如果你拉,那么,没有主分支。。。。这就是你犯错误的原因。在本地写一些东西,提交并推送到master,然后在远程就有了一些东西。

你在拉服务器repo吗?
git status
On branch master
Your branch is based on 'origin/master', but the upstream is gone.
  (use "git branch --unset-upstream" to fixup)

nothing to commit, working tree clean

touch test.txt
git commit -am "test file"
On branch master
Your branch is based on 'origin/master', but the upstream is gone.
  (use "git branch --unset-upstream" to fixup)

Untracked files:
    test.txt

nothing added to commit but untracked files present