Quantcast
Channel: CodeSection,代码区,Linux操作系统:Ubuntu_Centos_Debian - CodeSec
Viewing all articles
Browse latest Browse all 11063

Cloning problem 1 and 1 git repository in 1 and 1 Linux server shared with Eclip ...

$
0
0

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).


Viewing all articles
Browse latest Browse all 11063

Trending Articles