|Version 17 (modified by wdavison, 5 years ago)|
What is Git?
Git is a Source Code Management (SCM), a tool for software developers which supports collaborative development of software within a team, and the tracking of changes to software source code over time.
Git is used by developers, and advanced users who need the very latest changes to the software (before releases occur). Software users generally do not need Git; typically they will download official file releases made available by the project instead.
Developers should familiarize themselves with Git by reading the Git Documentation.
- All 1.6.x features of git are supported.
- Developer (read/write) access is provided via ssh.
- anonymous (read-only) access are provided via git's daemon protocol ("git://").
- Several Git clients are supported, including:
- The official git client (MS Windows, Mac OS X, Linux, BSD).
- Repositories may be viewed via web browser using the GitWeb.
- Existing repositories may be imported via a normal git push (since git is a distributed SCM).
- Repository access may be granted or revoked from a developer using the Project Admin interface.
- The normal set of hook scripts are supported, and may be changed by using adminrepo in our interactive shell service.
- Repository backups and mirroring may be performed using rsync or git clone.
- Service usage is not restricted by quotas.
Git service may be enabled for your project as follows:
- Login as a project administrator and go to the Project Summary page for your project.
- Select the Git option under the Admin menu.
- Under the "Enable Git" heading, check the "The following box should be checked to enable Git" checkbox and click the Update button. Your repository will be instantly enabled.
Once Git has been enabled, you may wish to adjust permssion grants for your users, if you need to disable one or more user's ability to make changes in the git repository.
The standard way to modify the contents of your repository is using a Git client as detailed in the Git User's Manual. Refer to the Getting Started section for how to make your first commit to your new repository.
To access a Git repository, configure your Git client as follows (replace PROJECTNAME with the UNIX group name of the project):
- git://PROJECTNAME.git.sourceforge.net/gitroot/PROJECTNAME (read-only)
- ssh://USERNAME@PROJECTNAME.git.sourceforge.net/gitroot/PROJECTNAME (read/write)
The read-only access does not prompt for a password.
The read/write access uses your ssh password or ssh key to authorize your access. To perform write operations, your project administrator must have granted you write access to the repository.
Your project's Git repository will be completely empty at the start, and Git does not allow a repository with no content to be cloned (checked out). What you will do instead is to push a Git repository that you create (or have previously created) from your own system to our servers. Since Git is a distributed version control system, having a copy of the full repository on your local system is the normal way things work.
How to create a new repository
Note: - For all examples below, "PROJECTNAME" represents a SourceForge.net project UNIX name and "USERNAME" represents your SourceForge.net user account.
Create an empty repository like this:
mkdir PROJECTNAME cd PROJECTNAME git init
Users should commit to their project repository using their SourceForge.net username. If that is not already set globally, you can set it locally for the current Git repository like this:
git config user.name "YOUR NAME" git config user.email "USERNAME@users.sourceforge.net"
You can now use whatever combination of "git add" and "git commit" commands you want to create one or more commits in your local repository.
How to push a local repository
Before you push your files, you need a local Git repository. You can either create one from scratch, convert a repository (e.g. via git-cvsimport or similar), or start with a copy of an existing Git repository.
For any local Git repository, you can configure it to push data back to our server by doing the following from inside your Git repository (this replicates what a "git clone" sets up for you automatically):
git remote add origin ssh://USERNAME@PROJECTNAME.git.sourceforge.net/gitroot/PROJECTNAME git config branch.master.remote origin git config branch.master.merge refs/heads/master
Now you're ready to push the committed files to our servers:
git push origin master
Note: The use of "origin master" prevents Git from complaining that the remote server has no branches in common with your local repository (which is true at the start when the remote repository is completely empty), and "master" is the default branch in Git.
After the first push, you will be able to use the simpler "git push" to push the master branch to our "origin" server.
Once that is done, you will be able to browse your newly-committed content via gitweb, clone the repository via either read-only or read/write access methods, push more check-ins, etc.
SourceForge.net performs routine backups for all of our servers and will restore from these backups in the event of catastrophic server failure. We encourage projects to make their own backups of Git data as that data restore can be performed by the project in the event of accidental data destruction by a member of the project team.
Backups of a Git repository may be made using rsync.
Example (replace PROJECTNAME with the UNIX group name of your project):
rsync -av PROJECTNAME.git.sourceforge.net::gitroot/PROJECTNAME/* .
Initial draft finished 2009-02-18