From Fedora Project Wiki
(First draft of more detailed instructions for hosting git repositories on fedorapeople.org)
 
m (Minor rewordings)
Line 1: Line 1:
== ''BETA'' git hosting support ==
== ''BETA'' git hosting support ==


fedorapeople now has support for hosting git repositories including accessing them via the git protocol for anonymous downloads as well as providing gitweb.  This should be considered beta.   
fedorapeople.org now has support for hosting git repositories including accessing them via the git:// protocol for anonymous downloads as well as providing gitweb.  This should be considered beta.   


==== Create a <code>public_git</code> directory in your home directory on fedorapeople.org ====
==== Create a <code>public_git</code> directory in your home directory on fedorapeople.org ====
Line 26: Line 26:
{{admon/note|Repository description|You can set the description for the repository that is displayed in gitweb by editing the description file in your repository.}}
{{admon/note|Repository description|You can set the description for the repository that is displayed in gitweb by editing the description file in your repository.}}


{{admon/note|Non-bare repositories|While non-bare repositories will work, they are generally discouraged as remote repositories.  If you use a non-bare repository, you should place the git-daemon-export-ok file in the toplevel git dir, e.g. ~/public_git/your_repo.git/git-daemon-export-ok}}
{{admon/note|Non-bare repositories|While non-bare repositories will work, they are generally discouraged for use as remote repositories.  But if you use a non-bare repository, you should place the git-daemon-export-ok file in the toplevel git dir, e.g. ~/public_git/your_repo.git/git-daemon-export-ok}}
 
==== Pushing to your repository ====


At this point your new repository is still empty.  You can push to it from a local repository with a little setup:
At this point your new repository is still empty.  You can push to it from a local repository with a little setup:
Line 38: Line 40:
{{admon/note|Allowing others to push|You can allow other fedorapeople.org users to push to your repository using extended acls (see "man setfacl" for details).  However, if you have many others working on your project, using [http://fedorahosted.org Fedora Hosted] is strongly preferred.}}
{{admon/note|Allowing others to push|You can allow other fedorapeople.org users to push to your repository using extended acls (see "man setfacl" for details).  However, if you have many others working on your project, using [http://fedorahosted.org Fedora Hosted] is strongly preferred.}}


==== Others can now clone your repository ====
==== Cloning your repository ====


To clone your repository, a user would use a command similar to:
To clone your repository, use a command similar to:
<code>git clone git://fedorapeople.org/~your_fedora_username/repo.git</code>
<code>git clone git://fedorapeople.org/~your_fedora_username/repo.git</code>



Revision as of 22:37, 3 October 2008

BETA git hosting support

fedorapeople.org now has support for hosting git repositories including accessing them via the git:// protocol for anonymous downloads as well as providing gitweb. This should be considered beta.

Create a public_git directory in your home directory on fedorapeople.org

ssh your_fedora_username@fedorapeople.org mkdir ~/public_git

Put your git repository in ~/public_git

Important.png
The repository directory name must end with .git
Gitweb will not list repos that do not end in .git.

For example, here is how to create a repository on your local system and upload it:

mkdir repo.git
cd repo.git
git init --bare
touch git-daemon-export-ok
cd ..
scp -r repo.git your_fedora_username@fedorapeople.org:public_git/
Important.png
Repository access
Without git-daemon-export-ok, your repository won't be available to anyone via the git:// protocol.
Note.png
Repository description
You can set the description for the repository that is displayed in gitweb by editing the description file in your repository.
Note.png
Non-bare repositories
While non-bare repositories will work, they are generally discouraged for use as remote repositories. But if you use a non-bare repository, you should place the git-daemon-export-ok file in the toplevel git dir, e.g. ~/public_git/your_repo.git/git-daemon-export-ok

Pushing to your repository

At this point your new repository is still empty. You can push to it from a local repository with a little setup:

cd /path/to/local/repo
git remote add fedorapeople your_fedora_username@fedorapeople.org:public_git/repo.git
git push --mirror fedorapeople
Note.png
Allowing others to push
You can allow other fedorapeople.org users to push to your repository using extended acls (see "man setfacl" for details). However, if you have many others working on your project, using Fedora Hosted is strongly preferred.

Cloning your repository

To clone your repository, use a command similar to: git clone git://fedorapeople.org/~your_fedora_username/repo.git

See your project in gitweb

You can see your project listed in gitweb once the project list updates (hourly). Note that this URL may change.