Creating a personal git tree: Difference between revisions

From OLPC
Jump to navigation Jump to search
(→‎Initialize a new bare repo: guess at inconsistency with project hosting)
No edit summary
Line 35: Line 35:
ssh USER@dev.laptop.org
ssh USER@dev.laptop.org
cd ~/public_git/PROJ
cd ~/public_git/PROJ
git --git-dir=. pull <repo-url>
git --git-dir=. fetch <repo-url>
</pre>
</pre>



Revision as of 19:57, 10 April 2008

Get permission to host the tree

These instructions assume that you wish to create a new personal git tree for a project named PROJ hosted in an account named USER on our hosting server, http://dev.laptop.org. See project_hosting for a directions on applying for an account.

Initialize a new bare repo

Git-web expects to find bare repositories (i.e. repos with no working directory). To make a new bare repo:

ssh USER@dev.laptop.org
mkdir -p ~/public_git/PROJ
cd ~/public_git/PROJ
git --bare init


As you may notice, this requires shell access to dev.laptop.org, which is generally not granted without specific needs. Usually, a git tree will be created for you as part of the application for hosting a project.

Edit the repo description

Fill in something meaningful for gitweb by putting a line in ~/public_git/PROJ/description.

Fill in the new repo

You can either push commits into the new repo, for example by running

cd LOCAL_PROJ
git push --all git+ssh://USER@dev.laptop.org/~/public_git/PROJ

or you can pull commits into the repo, by running:

ssh USER@dev.laptop.org
cd ~/public_git/PROJ
git --git-dir=. fetch <repo-url>

Further Reading

Git