kayzoe
kayzoe

Reputation: 61

Git an existing project

I am missing something. I am attempting to use Git with an existing project and get our team working with it. Following is what I did:

ssh [email protected]
cd /directory/of/gitProject
git init
git add .
git commit 'First commit'

I then thought to bring it to my local, I would exit from the ssh connection, then from my local: git clone [email protected]/directory/of/gitProject/.git myLocalGit

When I do this, I get that it does not appear to be a git repository.

Upvotes: 0

Views: 365

Answers (2)

Francisco Thiene
Francisco Thiene

Reputation: 11

I believe that, in your case, you should create your repository using --bare option. Try something like this:

mkdir project.git
cd project.git
git init --bare

Then you're able to clone it like this:

git clone [email protected]:/path/project.git

Upvotes: 1

David Deutsch
David Deutsch

Reputation: 19015

.git is not really a repository; the directory that contains it is. So you want to clone that directory, not .git.

By the way, when creating the repository on the server that you want to pull/push to/from, you should pass --bare to git init. Then make your first commit from your local machine, not on the server.

Upvotes: 1

Related Questions