Linaro Git Service HowTo
This page is intended to serve as concise quick reference on how to perform typical operations on Linaro Git servers (backed by Gitolite). For background and detailed information, yoy may refer to Platform/Systems/GitServer.
NOTE: There are few Linaro git servers for different projects. Instructions below assume the main git server, git.linaro.org. If you work with another server, please substitute its domain name instead.
Knowing all the commands
To get the list of all the available commands:
ssh git@git.linaro.org help
To get information on how to use a single command:
ssh git@git.linaro.org <COMMAND> -h
Permissions
To see where you have read (R), write (W) and create (C) permissions:
ssh git@git.linaro.org info
Note: pipe the above command through less, since it prints all repositories available on the server and the permissions you have.
R: indicates that you can read the repository
W: indicates that you can write (push) into that repository
C: indicates that you can create new repositories
Create new repository
To create a new repository on the server, push your local repository to the desired path (via the ssh:// protocol):
git push ssh://git@git.linaro.org:/path/to/repo.git
If you need to push to a defined branch, like mybranch:
git push ssh://git@git.linaro.org:/path/to/repo.git mybranch
Update repository description
Once you created a new repository, please set its decsription so others know what it is:
ssh git@git.linaro.org desc path/to/repository "Description"
Delete a repository
Two approaches are available to repository deletion:
Move it to the trash area: it will be recoverable for 30 days, after that it will be automatically deleted. (Recommended)
- Completely remove a repository: it will not be recoverable. (Admin use only!)
Checking delete permission
Only repositories created by users can be deleted (as opposed to repositories pre-created by an administrator directly on the server). Also, a repository can be deleted only by a user who created it, other users belonging to same "C" (create) permission group cannot do that. If you get "You are not authorised" error when trying to use commands above, run:
ssh git@git.linaro.org info -lc path/to/repo
(without .git at the end) to show the creator, then contact them to perform the deletion.
Completely remove a repository
ssh git@git.linaro.org D unlock path/to/repository ssh git@git.linaro.org D rm path/to/repository
Note: the path does not have to include the .git part.
Move a repository to the trash
ssh git@git.linaro.org D trash path/to/repository
The command will give you a path like:
repository/2014-03-18_14:56:31
Recover a trashed repository
Use that path from the previous step to recover the repository:
ssh git@git.linaro.org D restore repository/2014-03-18_14:56:31
Copy a repository (fork)
You need to have create permission (C) on the destination path to use this command.
ssh git@git.linaro.org fork origin/path destination/path
Repository README file
You need to have write permission (W) for the repository to use this command, and it must be under a path where you also have create (C) permission.
Set new README
cat README.html | ssh git@git.linaro.org readme path/to/repo set
Remove README
ssh git@git.linaro.org readme path/to/repo rm
Platform/Systems/Git (last modified 2015-01-27 16:17:33)