使用Eclipse EGit克隆1and1共享Linux服务器中的1and1 git存储库 [英] Problems cloning 1and1 git repository in 1and1 shared Linux server with Eclipse EGit

查看:200
本文介绍了使用Eclipse EGit克隆1and1共享Linux服务器中的1and1 git存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在我的1and1共享托管中设置了一个git仓库。 1and1提供git作为Linux业务包的一部分,我决定使用它,而不是安装我自己的git。



当我做dir .git我可以看到里面的信息存储库:

  -rw-r  -  r-- 1 foo ftpusers 23 Sep 6 19:41 HEAD 
drwxr-xr-x 2 foo ftpusers 6 Sep 6 19:41 branches
-rw-r - r-- 1 foo ftpusers 92 Sep 6 20:42 config
-rw-r - r- - 1 foo ftpusers 73 Sep 6 19:41 description
drwxr-xr-x 2 foo ftpusers 4096 Sep 6 19:41 hooks
-rw-r - r-- 1 foo ftpusers 1038768 Sep 6 19 :41 index
drwxr-xr-x 2 foo ftpusers 20 Sep 6 19:41 info
drwxr-xr-x 260 foo ftpusers 8192 Sep 6 19:41对象
drwxr-xr-x 4 foo ftpusers 29 Sep 6 19:41 refs

我的仓库位于/ project(完整路径1和1是/ homeepages / foo / bar / htdocs / project)



当我尝试使用Eclipse EGit访问它时,它表示存储库显示为b空的看到下面我已经尝试了到目前为止:

 协议:SSH 
端口:22
主机:示例.com
存储库路径:项目

错误消息:
无法列出可用的分支。
原因:ssh://< username> @ example.com:22 / project:fatal'/ project'
似乎不是git仓库。

然后我尝试更改存储库路径:

 存储库路径:project / .git 

相同的错误

然后我决定尝试使用我的服务器中的完整路径:

 存储库路径:/ homepage / foo / bar / htdocs / project / .git 

新错误:源Git存储库为空

因此,它似乎找到了git存储库。但是它显示为空。



顺便说一句,我在共享的1and1帐户中使用了用于创建git仓库的命令:



从我的帐户root:

  mkdir项目
cd项目
cp -r ../example/*。
git init
git add。

任何帮助赞赏。谢谢。

解决方案

存储库中命令行的git日志是什么结果?您看到的文件是使用git init创建的,并不意味着实际上已经提交了一些。看来你已经上传文件但没有提交它们。这是一个相当普遍的错误,因为大多数其他版本控制系统没有类似的步骤。一旦您开始使用它来构建修补程序(例如使用 git add -p )这是非常宝贵的。



某些资源开始使用git:



progit 是一本很好的书这是在线免费提供的。它由github的创始人之一撰写。



git社区书是另一本关于git的在线书籍。它与进度之间有很多重叠,但是与某些事情(例如其对树的描述)相比更深入。


I have just setup a git repository in my 1and1 shared hosting. 1and1 offers git as part of the Linux business package and I decided to use it instead of installing my own git.

When I do dir .git I can see the information inside the repository:

-rw-r--r--   1 foo ftpusers      23 Sep  6 19:41 HEAD
drwxr-xr-x   2 foo ftpusers       6 Sep  6 19:41 branches
-rw-r--r--   1 foo ftpusers      92 Sep  6 20:42 config
-rw-r--r--   1 foo ftpusers      73 Sep  6 19:41 description
drwxr-xr-x   2 foo ftpusers    4096 Sep  6 19:41 hooks
-rw-r--r--   1 foo ftpusers 1038768 Sep  6 19:41 index
drwxr-xr-x   2 foo ftpusers      20 Sep  6 19:41 info
drwxr-xr-x 260 foo ftpusers    8192 Sep  6 19:41 objects
drwxr-xr-x   4 foo ftpusers      29 Sep  6 19:41 refs

My repository is located at /project (full path at 1and1 is /homepages/foo/bar/htdocs/project)

When I try to access it using Eclipse EGit it says that the repository appears to be empty. See below what I have attempted so far:

Protocol: SSH
Port: 22
Host: example.com
Repository path: project

Error Message:
Cannot list available branches.
Reason: ssh://<username>@example.com:22/project: fatal '/project'
does not appear to be a git repository.

Then I tried changing the repository path:

Repository path: project/.git

Same error

Then I decided to try with the full path in my server:

Repository path: /homepages/foo/bar/htdocs/project/.git

New error: Source Git Repository is empty

So it seems that it finds the git repository. However it is showing as empty.

By the way, see below the commands I used to create the git repository in my shared 1and1 account:

from my account root:

mkdir project
cd project
cp -r ../example/* .
git init
git add .

Any help appreciated. Thanks.

解决方案

What is the result of a git log from the command line in the repository? The files you see are created with git init and do not mean something has actually been committed. It appears that you have staged files but not committed them. It's a fairly common mistake since most other Version Control Systems don't have an analogous step. Once you start using it to build patches (using git add -p for example) it's invaluable.

Some resources for getting started with git:

progit is an excellent book that is freely available online. It's written by one of the founders of github.

The git community book is another online book on git. There is a lot of overlap between it and progit but it goes more in depth with certain things (such as its description of treeishes).

这篇关于使用Eclipse EGit克隆1and1共享Linux服务器中的1and1 git存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆