git - git pull 故障排除

标签 git ubuntu tortoisegit git-pull

我在用作媒体中心/备份服务器的 Ubuntu 机器上通过 ssh 设置了一个 git 存储库。

我采取的步骤是:

cd repos
git init <repoName>
cd <repoName>
git config --bool core.bare true

我已经能够通过 TortoiseGit 从我的台式机和笔记本电脑成功推送和 pull ,但是通过 SSH 返回的 git pull:

fatal: /usr/lib/git-core/gitpull cannot be used without a working tree. 

我是终端/ssh 的新手,所以非常感谢任何帮助!

最佳答案

你必须推送到一个裸仓库。 Pull 将不起作用,因为它需要一个工作目录才能 merge 到,这就是您看到的错误消息所说的内容。

因此,从您将要处理的存储库中设置一个远程到裸存储库,并从中推送。

PS:创建裸仓库的理想方式是执行 git init --bare <reponame>

关于git - git pull 故障排除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8565828/

相关文章:

git - 在 CI 服务器中构建 merge 请求

git - 如何使用 Windows Tortoise 从 Git 存储库中删除文件?

windows - 我可以在全局范围内使用 TortoiseGit 注册 PuTTY key 吗(不是每个存储库)?

php - docker |管道失败 ubuntu 源列表

c - pr_* 和 printk 不打印

git - TortoiseGit 取消整个文件夹的版本

windows - Git for Windows (Git Bash) 中的包管理?

java - 删除 bitbuck 中的文件夹

git - 如何从 phpstorm 的本地 git 存储库中删除提交?

python - 如何在 Ubuntu 14.04 上安装 wxPython 3.0.2.0?