git clone locally

Hi,

I follow the instructions below to set up a git repository with
gitosis on my home ubuntu server. I can connect to the repository
remotely perfectly and set up a new repository named My_Project. I
successfully push the content of My_Project to this repository using
the remote computer with an SSH key. Now I want to clone My_Project
locally onto another directory within the unbuntu server. How can I
do this? The instructions are only to clone remotely. It appears
that the clone command allows a "local" option but I haven't been able
to get it to work.

http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way

Sorry for this seemingly off topic question. I use git in my rails
programming process and can't find an active git support group.

Thanks.

Learn by Doing wrote:

Hi,

I follow the instructions below to set up a git repository with
gitosis on my home ubuntu server. I can connect to the repository
remotely perfectly and set up a new repository named My_Project. I
successfully push the content of My_Project to this repository using
the remote computer with an SSH key. Now I want to clone My_Project
locally onto another directory within the unbuntu server. How can I
do this? The instructions are only to clone remotely. It appears
that the clone command allows a "local" option but I haven't been able
to get it to work.

http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way

Sorry for this seemingly off topic question. I use git in my rails
programming process and can't find an active git support group.

As far as I know, the Git mailing list is quite active. You should
probably ask there.

Thanks.

Best,

From "git help clone":

       --local, -l
           When the repository to clone from is on a local machine, this flag
           bypasses normal "git aware" transport mechanism and clones the
           repository by making a copy of HEAD and everything under objects
           and refs directories. The files under .git/objects/ directory are
           hardlinked to save space when possible. This is now the default
           when the source repository is specified with /path/to/repo syntax,
           so it essentially is a no-op option. To force copying instead of
           hardlinking (which may be desirable if you are trying to make a
           back-up of your repository), but still avoid the usual "git aware"
           transport mechanism, --no-hardlinks can be used.

Thanks all. I found out that I needed to use sudo before git in order for
the -local option to work in my case.

BTW, what is the most active git support group? I looked on Google group
but couldn't find one. Thanks much.

You should not need to use --local or sudo, just

git clone path/to/filename.git

Colin

There IS a git users group on google groups:

http://groups.google.com/group/git-users

Hi Colin,

I get this error if I just do git clone: fatal: failed to open /var/
gitosis/repositories/vincentProject.git/objects

But the following works: git clone git@localhost:vincentProject.git
clonedProject
That works after I add my public key to keydir folder under gitosis
and add my username to the members list for vincentProject in gitosis
config file. This is fine. But is there a better way?

One other problem: whenever I do a git pull, git asks me for my
passphrase for my key. Is there anyway for me to avoid this? I use
another account on a remote computer to do the pull and it works
without asking me for the passphrase of that account.

Thanks.

Hi Colin,

I get this error if I just do git clone: fatal: failed to open /var/

gitosis/repositories/vincentProject.git/objects

But the following works: git clone git@localhost:vincentProject.git

clonedProject

That works after I add my public key to keydir folder under gitosis

and add my username to the members list for vincentProject in gitosis

config file. This is fine. But is there a better way?

One other problem: whenever I do a git pull, git asks me for my

passphrase for my key. Is there anyway for me to avoid this? I use

another account on a remote computer to do the pull and it works

without asking me for the passphrase of that account.

Thanks.

Thanks all. I found out that I needed to use sudo before git in order for

the -local option to work in my case.

You should not need to use --local or sudo, just

git clone path/to/filename.git

Colin

Vincent, you will need to use the following syntax instead:

git clone path/to/directory_name # This is the same as git clone -l path/to/directory_name.

For more information, I would recommend referencing the following web sit for git related

information:

http://git-scm.com

Good luck,

-Conrad

Hi Conrad,

I did use the syntax you suggested. Below is the error.
Thanks.

~$ git clone /var/gitosis/repositories/vincentProject.git

Initialized empty Git repository in /home/master/vincentProject /.git/

fatal: failed to open /var/gitosis/repositories/vincentProject.git/objects

I think that’s because the repo belongs to the git user under
gitosis. But I did add my SSH key to keydir folder and add myself to the members
list for this project. I don’t know why git still prevents me from cloning. That’s
why I had to use: git clone git@localhost:vincentProject.git
clonedProject. This works. The only drawback with this method is that it asks
me for my passphrase for my SSH key every time.

Thanks.

Vincent.

From:
rubyonrails-talk@googlegroups.com [mailto:rubyonrails-talk@googlegroups.com] On
Behalf Of
Conrad Taylor

Hi Conrad,

I did use the syntax you suggested. Below is the error.
Thanks.

~$ git clone /var/gitosis/repositories/vincentProject.git

Initialized empty Git repository in /home/master/vincentProject /.git/

fatal: failed to open /var/gitosis/repositories/vincentProject.git/objects

I think that’s because the repo belongs to the git user under
gitosis. But I did add my SSH key to keydir folder and add myself to the members
list for this project. I don’t know why git still prevents me from cloning. That’s
why I had to use: git clone git@localhost:vincentProject.git
clonedProject. This works. The only drawback with this method is that it asks
me for my passphrase for my SSH key every time.

Vincent, if you’re using SSH, then you should also be able to access the repository as

follows:

got clone git@localhost/repositories/vincentProject.git

Next, you cannot use a local method of cloning your repository because you’re using

SSH. Thus, you cannot do

git clone /path/to/repositories/vincentProject

However, you may do this if the current user is ‘git’

git clone /repositories/vincentProject.git

Furthermore, you’ll need to learn more about the tools you’re using before you put them into

practice. For example, you should have been fairly comfortable with git basics before adding

a tool like gitosis to the mix. There are many resources to get up to speed with git which include

screencasts. Lastly, I haven’t used gitosis so I will not be able to help you here.

Good luck,

-Conrad

Thanks.

Vincent.

Vincent, you might want to learn more about the IDE

Conrad Taylor wrote:

Conrad Taylor wrote:

Initialized empty Git repository in /home/master/vincentProject /.git/

[…]

Folks, this is not the Git list. Please take this discussion somewhere

where it is on topic.

I follow the list pretty closely and there have been a lot of off topic discussions in the past

from database comparison to whether one should choose a Mac to what’s the best editor. The

community has embraced Git as the source code control system. Thus, I feel that it’s reasonable

to assist a fellow Rails developer by simply answering the question. Yes, it would be great to

direct questions/answers/comments to correct group or mailing list but that’s not always the case

in practice.

-Conrad

Conrad Taylor wrote:

Conrad Taylor wrote:
>
>> Initialized empty Git repository in /home/master/vincentProject /.git/
[...]

Folks, this is not the Git list. Please take this discussion somewhere
where it is on topic.

I follow the list pretty closely and there have been a lot of off topic
discussions in the past
from database comparison to whether one should choose a Mac to what's
the
best editor.

Yes -- for Rails development. A general question on whether to choose a
Mac would not be appropriate here. Neither would basic Mac OS
instruction.

The
community has embraced Git as the source code control system. Thus, I
feel

But this is not about what you or I feel.

that it's reasonable
to assist a fellow Rails developer by simply answering the question.

Yup. A simple answer and/or a pointer to the Git list. The OP is
asking a Git question that isn't related to Rails. It's off topic here.
Please take the discussion elsewhere.

Yes,
it would be great to
direct questions/answers/comments to correct group or mailing list but
that's not always the case
in practice.

Sure it is. And if it's not, that's a mistake.

-Conrad

Best,

Conrad Taylor wrote:

Conrad Taylor wrote:

Initialized empty Git repository in /home/master/vincentProject /.git/

[…]

Folks, this is not the Git list. Please take this discussion somewhere

where it is on topic.

I follow the list pretty closely and there have been a lot of off topic

discussions in the past

from database comparison to whether one should choose a Mac to what’s

the

best editor.

Yes – for Rails development. A general question on whether to choose a

Mac would not be appropriate here. Neither would basic Mac OS

instruction.

The

community has embraced Git as the source code control system. Thus, I

feel

But this is not about what you or I feel.

that it’s reasonable

to assist a fellow Rails developer by simply answering the question.

Yup. A simple answer and/or a pointer to the Git list. The OP is

asking a Git question that isn’t related to Rails. It’s off topic here.

Please take the discussion elsewhere.

Yes,

it would be great to

direct questions/answers/comments to correct group or mailing list but

that’s not always the case

in practice.

Sure it is. And if it’s not, that’s a mistake.

-Conrad

Best,

In short, you have the right to read or not read a thread. With that being said, this discussion

is closed.

-Conrad

Hi Conrad,

Thank you very much for your thorough explanation. I submitted
my question to git-users@googlegroups.combut
it appears that that group is moderated, my question took days to be posted,
and the traffic was low. I needed gitosis to collaborate with another Rails
developer (we are uncomfortable with Github confidentiality protection). Your
prompt help saved the day. I find the responsiveness of this Rails Talk group
a compelling reason to become a Rails developer.

Thanks,

Vincent.

From:
rubyonrails-talk@googlegroups.com [mailto:rubyonrails-talk@googlegroups.com] On
Behalf Of
Conrad Taylor

Conrad Taylor wrote:

>>
Yes -- for Rails development. A general question on whether to choose a
> to assist a fellow Rails developer by simply answering the question.

Sure it is. And if it's not, that's a mistake.

>
> -Conrad

Best,

In short, you have the right to read or not read a thread.

If that were the whole story, there would never be any need to declare a
topic for a discussion group.

With that
being
said, this discussion
is closed.

That's not your decision. Or mine.

-Conrad

Best,