git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Emily Ren" <lingyan.ren@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Can I prevent someone clone my git repository?
Date: Thu, 08 Jan 2009 00:36:17 -0800	[thread overview]
Message-ID: <7vr63e42ke.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 856bfe0e0901072303i4fcd3bf6u99790ab9f4170937@mail.gmail.com

"Emily Ren" <lingyan.ren@gmail.com> writes:

> I want some person can clone my git repository, others can't clone my
> git repository. Is it realizable ? How to do it?

It depends on what transport these people come from.

On the local filesystem transport (either same host or network-mounted
filesystem), you do it the same way as you solve "how do I show these
files of mine on the local computer to some but not others".  Typically,
you place these group members in the same UNIX group, make the toplevel
directory of the hierarchy owned by the group, and "chmod g+rx,o=" it (and
make everything underneath group readable).  Setting core.sharedrepository
configuration variable would help maintain the group readability.

If they come over the http transport, you would solve it the same way as
you solve "how do I allow access to these files on my webserver to only
selected few?"  Probably .htaccess file in the toplevel directory will be
involved.

You can set up gitosis and have it serve your repository, and register
group members' SSH keys to gitosis.  It allows you to categorize these
users into different groups, and assign read-only or read-write access to
repositories.  When this is done, these people will be coming over the
"git over ssh" transport, i.e. git@your-host:/path/to/repository.git/
or its synonym ssh://git@your-host/path/to/repository.git/

The git-daemon transport deliberately omits authentication, and you cannot
restrict when they come over the git native transport using a URL like
git://your-host/repository.git

-jc

  reply	other threads:[~2009-01-08  8:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-08  7:03 Can I prevent someone clone my git repository? Emily Ren
2009-01-08  8:36 ` Junio C Hamano [this message]
2009-01-08  8:59   ` Johannes Sixt
2009-01-08  9:33     ` Emily Ren
2009-01-08  9:41       ` Johannes Sixt
2009-01-08 11:27   ` Johannes Schindelin
2009-01-08 14:32     ` Miklos Vajna
2009-01-08 14:42       ` Johannes Schindelin
2009-01-08 15:29         ` Shawn O. Pearce
2009-01-08 15:49           ` Johannes Schindelin
2009-01-08 15:56             ` Shawn O. Pearce
2009-01-08 16:06               ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vr63e42ke.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=lingyan.ren@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).