From Fedora Project Wiki
(Fix location of git-daemon-export-ok for non-bare repos (though non-bare repos should probably be discouraged))
(Expand the section on using git to include some examples of common usage; remove extraneous newlines in scp example)
Line 28: Line 28:


<pre>
<pre>
scp /path/to/file your_fedora_username@fedorapeople.org:/home/fedora/your_fedora_username/public_html
scp /path/to/file your_fedora_username@fedorapeople.org:/home/fedora/your_fedora_username/public_html
</pre>
</pre>


Line 41: Line 39:
== ''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.''
 
Here is a quick rundown of how to get started using git on fedorapeople.org.  It assumes that you are already somewhat familiar with git.  For a quick reference to git, see [[Git_Quickref]].
 
=== Create a <code>~/public_git</code> directory on fedorapeople.org ===
 
<pre>ssh your_fedora_username@fedorapeople.org "mkdir ~/public_git"</pre>
 
 
=== Creating a new git repository in <code>~/public_git</code> ===
 
As an example, here is one method to create an empty repository ''on your local system'' and upload it:
 
<pre>
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/
</pre>
 
This creates a ''bare'' repository (i.e. a repository that has no working directory).  It contains just the files that are part of the <code>.git</code> directory of a ''non-bare'' git repository (the kind most users are accustomed to seeing).
 
 
{{admon/important|Repository name must end with .git|Gitweb will not list repos that do not end in <code>.git</code>.|}}
 
{{admon/important|Repository access and git-daemon-export-ok|Without the <code>git-daemon-export-ok</code> file, your repository won't be available anonymously via the git:// protocol.}}
 
{{admon/caution|Non-bare repositories|While non-bare repositories ''should'' work, it is [http://git.or.cz/gitwiki/GitFaq#git-push%20non-bare generally discouraged] to push to such repositories.  However, if you do use a non-bare repository, you should place the git-daemon-export-ok file in the top-level git dir, e.g. <code>~/public_git/your_repo.git/git-daemon-export-ok</code>, '''NOT''' <code>~/public_git/your_repo.git/.git/git-daemon-export-ok</code>}}
 
 
=== Uploading an existing repository to <code>~/public_git</code> ===
 
If you have an existing repository you want to use on fedorapeople, you can do so easily:
 
<pre>
git clone --bare /path/to/local/repo repo.git
touch repo.git/git-daemon-export-ok
scp -r repo.git your_fedora_username@fedorapeople.org:public_git/
</pre>
 
The caveats from the previous section apply here as well.
 
 
=== Pushing to your repository ===
 
To push changes from a local repository:
 
<pre>
cd /path/to/local/repo
git remote add fedorapeople your_fedora_username@fedorapeople.org:public_git/repo.git
git push --mirror fedorapeople
</pre>
 
This creates a mirror of your local repository.  All of the branches and tags in the local repository will be pushed to the fedorapeople repository.
 
If you only want to push selected branches, amend the <code>git push</code> example.  For example, to push only your local master branch:
 
<pre>git push fedorapeople master</pre>
 
 
{{admon/tip|Allowing others to push|You can allow other fedorapeople.org users to push to your repository using extended acls (see <code>setfacl(1)</code> for details).  However, if you have many others working on your project, using [http://fedorahosted.org Fedora Hosted] is strongly preferred.}}
 
 
=== Cloning your repository ===
 
To clone your repository, use a command similar to:
 
<pre>git clone git://fedorapeople.org/~your_fedora_username/repo.git</pre>
 
 
It is also possible to clone your project via the http:// protocol.  In order for this to work, you must arrange to have <code>git-update-server-info</code> run whenever you update your repository.  Typically, this is done with a post-update hook script.  However, the user home directories on fedorapeople.org are mounted with the noexec option, which prevents the script from running.  Instead, you may create a symbolic link to <code>git-update-server-info</code> in the hooks directory of your repository:
 
<pre>
ssh ~your_fedora_username@fedorapeople.org
cd ~/public_git/repo.git/hooks
ln -svbf /usr/bin/git-update-server-info post-update
</pre>
 
 
You can clone your repository over http:// with a command similar to:
 
<pre>git clone http://your_fedora_username.fedorapeople.org/git/repo.git/</pre>
 
 
{{admon/tip|git:// versus http://|Only clone via http:// if you are behind a firewall that prevents git:// from workingThe git:// protocol is faster and more efficient than the http:// protocol for git usage.}}
 
 
=== Browsing your project via gitweb ===
 
You can see your project listed in [http://fedorapeople.org/gitweb gitweb] once the project list updates.  This happens hourly.  ''Note that the gitweb URL may change.''
 


* Create a <code>public_git</code> directory in your home directory
{{admon/tip|Repository description|You can set the description for the repository that is displayed in gitweb by editing the description file in your repository.}}
* Put your git repository under this directory. The repository directory name must end with .git or gitweb will not acknowledge it. Common methods for initially doing this would be rsync or scp of a repository you already have.
* Touch the <code>git-daemon-export-ok</code> file in the repository.  This makes it so that others have access to the repository
** if this is a non-bare repo, <code>git-daemon-export-ok</code> should live here:  <code>~/public_git/your_repo.git/git-daemon-export-ok</code>
* You can also set a description for the project by editing the <code>description</code> file in the repository
* Users can clone your repository via something like <code>git clone git://fedorapeople.org/~katzj/isomd5sum.git</code>
* You can push to this repository via ssh now. Also, you can give other users access via acls as described above, but for more use of this, it is preferred to use the [http://fedorahosted.org Fedora Hosted] site
* You can see your project listed in [http://fedorapeople.org/gitweb gitweb] once the project list updates (hourly).  ''Note that this URL may change''


[[Category:Infrastructure]]
[[Category:Infrastructure]]

Revision as of 01:41, 7 October 2008

fedorapeople.org

This page covers the details on how to obtain and use your personal space on fedorapeople.org , which is a site where Fedora contributors can upload files for sharing out with the world. It is perfect for uploading specfiles, srpms, patches, personal repository etc, etc.

Accessing Your fedorapeople.org Space

  1. You need an active Fedora account
  2. You must be sponsored in a group (other than the CLA groups)
  3. To connect, use the ssh key you uploaded into your Fedora account:
ssh your_fedora_username@fedorapeople.org

Common Answers

  • Each Fedora contributor has 150 MiB of quota-controlled space.
  • To make a publicly viewable space, create a public_html directory.
  • Upload files using scp, sftp, or rsync.
Using Nautilus
If you use GNOME, visit this page for an easy way to connect to your fedorapeople.org space.
Using Dolphin or Konqueror
If you use KDE, type sftp://your_username@fedorapeople.org in your file manager address bar for an easy way to connect to your fedorapeople.org space.

To copy files from the command line, you can use scp

scp /path/to/file your_fedora_username@fedorapeople.org:/home/fedora/your_fedora_username/public_html


  • Once uploaded into the users public_html directory the files are available via http at: http://your_username.fedorapeople.org/.
  • Give other users access to read/write/etc files by using extended acls. Read man pages for setfacl and getfacl for adding them to your dirs/files. This gives the user jkeating read and write access to file:
setfacl -m u:jkeating:rw file

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.

Here is a quick rundown of how to get started using git on fedorapeople.org. It assumes that you are already somewhat familiar with git. For a quick reference to git, see Git_Quickref.

Create a ~/public_git directory on fedorapeople.org

ssh your_fedora_username@fedorapeople.org "mkdir ~/public_git"


Creating a new git repository in ~/public_git

As an example, here is one method to create an empty 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/

This creates a bare repository (i.e. a repository that has no working directory). It contains just the files that are part of the .git directory of a non-bare git repository (the kind most users are accustomed to seeing).


Repository name must end with .git
Gitweb will not list repos that do not end in .git.
Repository access and git-daemon-export-ok
Without the git-daemon-export-ok file, your repository won't be available anonymously via the git:// protocol.
Non-bare repositories
While non-bare repositories should work, it is generally discouraged to push to such repositories. However, if you do use a non-bare repository, you should place the git-daemon-export-ok file in the top-level git dir, e.g. ~/public_git/your_repo.git/git-daemon-export-ok, NOT ~/public_git/your_repo.git/.git/git-daemon-export-ok


Uploading an existing repository to ~/public_git

If you have an existing repository you want to use on fedorapeople, you can do so easily:

git clone --bare /path/to/local/repo repo.git
touch repo.git/git-daemon-export-ok
scp -r repo.git your_fedora_username@fedorapeople.org:public_git/

The caveats from the previous section apply here as well.


Pushing to your repository

To push changes from a local repository:

cd /path/to/local/repo
git remote add fedorapeople your_fedora_username@fedorapeople.org:public_git/repo.git
git push --mirror fedorapeople

This creates a mirror of your local repository. All of the branches and tags in the local repository will be pushed to the fedorapeople repository.

If you only want to push selected branches, amend the git push example. For example, to push only your local master branch:

git push fedorapeople master


Allowing others to push
You can allow other fedorapeople.org users to push to your repository using extended acls (see setfacl(1) 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


It is also possible to clone your project via the http:// protocol. In order for this to work, you must arrange to have git-update-server-info run whenever you update your repository. Typically, this is done with a post-update hook script. However, the user home directories on fedorapeople.org are mounted with the noexec option, which prevents the script from running. Instead, you may create a symbolic link to git-update-server-info in the hooks directory of your repository:

ssh ~your_fedora_username@fedorapeople.org
cd ~/public_git/repo.git/hooks
ln -svbf /usr/bin/git-update-server-info post-update


You can clone your repository over http:// with a command similar to:

git clone http://your_fedora_username.fedorapeople.org/git/repo.git/


git:// versus http://
Only clone via http:// if you are behind a firewall that prevents git:// from working. The git:// protocol is faster and more efficient than the http:// protocol for git usage.


Browsing your project via gitweb

You can see your project listed in gitweb once the project list updates. This happens hourly. Note that the gitweb URL may change.


Repository description
You can set the description for the repository that is displayed in gitweb by editing the description file in your repository.