Git.alt reference: Difference between revisions

From ALT Linux Wiki
m (→‎init-db: Minor rephrasing)
(Translated the articles on mv-db, rm-db and auxiliary commands)
Line 83: Line 83:
  '''$ ssh git.alt find-package <pattern>'''
  '''$ ssh git.alt find-package <pattern>'''


This command searches repositories with names matching <pattern>. The only wildcard character allowed in <pattern> is <tt>*</tt> (asterisk). It is assumed that all public <tt>gear</tt>-repos are located in <tt>packages</tt> directories of each user, so repos are only searched in these directories.
This command searches repositories with names matching <pattern>. The only wildcard character allowed in <pattern> is <tt>*</tt> (asterisk). It is assumed that all public <tt>gear</tt>-repos are located in <tt>packages/</tt> directories of each user, so repos are only searched in these directories.


  $ ssh git.alt find-package glibc*
  $ ssh git.alt find-package glibc*
Line 102: Line 102:
  '''$ ssh git.alt clone <path to git repository> [<destination directory>]'''
  '''$ ssh git.alt clone <path to git repository> [<destination directory>]'''


This command clones a repository, i.e. makes a copy of a repository in the specified directory (or in <tt>packages</tt> directory, if none specified) so that you can start hacking on it.
This command clones a repository, i.e. makes a copy of a repository in the specified directory (or in <tt>packages/</tt> directory, if none specified) so that you can start hacking on it.


  $ ssh git.alt clone /people/ldv/glibc.git
  $ ssh git.alt clone /people/ldv/glibc.git
Line 129: Line 129:
  '''$ ssh git.alt init-db <path to directory>'''
  '''$ ssh git.alt init-db <path to directory>'''


Creates a new Git repo. By default, the repo is created in <tt>packages</tt> directory.
Creates a new Git repo. By default, the repo is created in <tt>packages/</tt> directory.
  $ ssh git.alt init-db test
  $ ssh git.alt init-db test
  Initialized empty Git repository in ./
  Initialized empty Git repository in ./
Line 139: Line 139:
  girar-init-db: /people/dottedmag/public/test.git
  girar-init-db: /people/dottedmag/public/test.git


<!--==== mv-db ====
==== mv-db ====


  '''$ ssh git.alt mv-db <path to source directory> <path to destination directory>'''
  '''$ ssh git.alt mv-db <path to source directory> <path to destination directory>'''
Позволяет перемещать и переименовывать свои репозитории. При указании только имени репозитория подразумевается директория <tt>packages</tt>.
Allows to move and rename repositories. If only a repository name is given (without path), <tt>packages/</tt> directory is used.


Перемещение packages/test.git в public/newname.git:
Moving packages/test.git to public/newname.git:
  $ ssh git.alt mv-db test public/newname
  $ ssh git.alt mv-db test public/newname
  $
  $
Перемещение public/newname.git в packages/test.git:
Moving public/newname.git to packages/test.git:
  $ ssh git.alt mv-db public/newname test
  $ ssh git.alt mv-db public/newname test
  $
  $
Переименовывание packages/test.git в packages/megatest.git:
Renaming packages/test.git to packages/megatest.git:
  $ ssh git.alt mv-db test megatest
  $ ssh git.alt mv-db test megatest
  $
  $
Line 157: Line 157:


  '''$ ssh git.alt rm-db <path to git repository>'''
  '''$ ssh git.alt rm-db <path to git repository>'''
Позволяет удалять свои репозитории. При указании только имени репозитория подразумевается директория <tt>packages</tt>:
Removes a repository. If only a repository name is given (without path), <tt>packages/</tt> directory is used:
  $ ssh git.alt rm-db megatest # удаляет packages/megatest.git
  $ ssh git.alt rm-db megatest # removes packages/megatest.git
  $ ssh git.alt rm-db public/test
  $ ssh git.alt rm-db public/test


==== Вспомогательные команды ====
==== Auxiliary commands ====


===== charset =====
===== charset =====
Line 167: Line 167:
  '''$ ssh git.alt charset <path to git repository> [<charset>]'''
  '''$ ssh git.alt charset <path to git repository> [<charset>]'''


Позволяет узнать или установить кодировку, отдаваемую web-сервером при отдаче raw-файлов указанного git-репозитория:
Obtain or set the charset for raw-files of the specified git-repository. This is used by the git.alt web server to set the proper charset when a user downloads the file.


  $ ssh git.alt charset packages/glibc
  $ ssh git.alt charset packages/glibc
Line 180: Line 180:
  '''$ ssh git.alt quota'''
  '''$ ssh git.alt quota'''


Позволяет узнать квоту и занимаемое пользователем дисковое пространство.
Displays the user's quota and the used space.


  $ ssh git.alt quota
  $ ssh git.alt quota
Line 189: Line 189:
===== git-receive-pack, git-upload-pack =====
===== git-receive-pack, git-upload-pack =====


Эти команды используются утилитами <tt>git-push</tt>, <tt>git-pull</tt> и подобными и не предназначены для вызова пользователем.
These commands are used internally by <tt>git-push</tt>, <tt>git-pull</tt> and other utilities. You should not run them explicitly.


==== task, build ====
==== task, build ====


Пока что не функционируют.
Not implemented yet.


=== Клонирование и работа с репозиториями ===
<!--=== Клонирование и работа с репозиториями ===


Работа с git-репозиториями, расположенными на <tt>git.alt</tt>, ничем не отличается от работы с другими git-репозиториями.
Работа с git-репозиториями, расположенными на <tt>git.alt</tt>, ничем не отличается от работы с другими git-репозиториями.

Revision as of 17:11, 22 August 2008

Stub.png
Under construction.
This page is not finished yet and may lack substantial information.

How to use

git.alt provides the following kinds of access to the repositories:

  • SSH. Special commands are provided: repos search, cloning, creation, deletion, build invocation and control, and some auxiliary ones.
  • ssh:, git:, http: provide immediate access to repositories. With git: and http: you can only do read-only operations, ssh: gives read-write access.
  • Web interface. It is located here: http://git.altlinux.org/ and provides repos navigation and gitweb for each individual repo.

SSH access to git.alt is only granted to persons who joined ALT Linux Team.

SSH access

You can use git.alt via SSH at git.altlinux.org:222. The login name is your ALT Linux Team username with _ (underscores) instead of - (hyphens), if there are any.

Here is an example of an entry in your ~/.ssh/config file:

Host git.alt
  HostName git.altlinux.org
  Port 222
  User git_USERNAME

If your are behind a proxy, most ports are blocked etc., you can also access SSH with the address git.altlinux.org:443.

The list of available commands is displayed, when you login to SSH without commands or with help command:

$ ssh git.alt help
Available commands:
help
git-receive-pack <directory>
git-upload-pack <directory>
charset <path to git repository> [<charset>]
clone <path to git repository> [<path to directory>]
find-package <pattern>
init-db <path to directory>
ls [<path to directory>]
mv-db <path to source directory> <path to destination directory>
quota
rm-db <path to git repository>
task {list|new|show|drop|add|run} ...
build <path to gear repository> <tag name> [<binary package repository name>] [<project name>]
$

In all commands, the .git suffix for repositories is optional and may be omitted; but in the output of commands this suffix is always appended.

ls

$ ssh git.alt ls [<directory>]

Similar to UNIX ls, this command lets you see contents of directories at git.alt:

$ ssh git.alt ls /people/dottedmag/public
total 24
drwxr-sr-x 5 4096 Jun 13 10:22 bugzilla-repo-sync.git
...
drwxr-sr-x 5 4096 Jul  7 18:03 wackoconvert.git
$

The command issued without parameters displays the contents of /people/$USERNAME:

$ ssh git.alt ls
total 16
drwxr-s---  5 4096 May 30 21:27 etc
drwxr-sr-x 14 4096 Aug 13 23:53 packages
drwxr-s--x  2 4096 Feb 13  2007 private
drwxr-sr-x  8 4096 Aug 13 23:57 public
$

The same directory is used as a base for relative paths:

$ ssh git.alt ls public
total 24
drwxr-sr-x 5 4096 Jun 13 10:22 bugzilla-repo-sync.git
...
drwxr-sr-x 5 4096 Jul  7 18:03 wackoconvert.git
$

find-package

$ ssh git.alt find-package <pattern>

This command searches repositories with names matching <pattern>. The only wildcard character allowed in <pattern> is * (asterisk). It is assumed that all public gear-repos are located in packages/ directories of each user, so repos are only searched in these directories.

$ ssh git.alt find-package glibc*
/people/avm/packages/glibc.git	1216320095
...
/people/peet/packages/glibc-kernheaders.git	1177084354
/people/mike/packages/glibc-kvercheck.git	1160664813
$ ssh git.alt find-package glibc
/people/avm/packages/glibc.git	1216320095
...
/people/peet/packages/glibc.git	1177084600
$

The second column in find-package output is a unixtime of the last repo update.

clone

$ ssh git.alt clone <path to git repository> [<destination directory>]

This command clones a repository, i.e. makes a copy of a repository in the specified directory (or in packages/ directory, if none specified) so that you can start hacking on it.

$ ssh git.alt clone /people/ldv/glibc.git
Initialized empty Git repository in /people/dottedmag/packages/glibc.git/
$

You can also specify a repository name instead of just a destination directory as the second parameter:

$ ssh git.alt clone /people/ldv/glibc.git public
Initialized empty Git repository in /people/dottedmag/public/glibc.git/
$ ssh git.alt clone /people/ldv/glibc.git public/test
Initialized empty Git repository in /people/dottedmag/public/test.git/
$

You can also clone a repository from outside git.alt:

$ ssh git.alt clone http://github.com/dottedmag/madshelf.git public
Initialized empty Git repository in /people/dottedmag/packages/public.git/
Getting alternates list for http://github.com/dottedmag/madshelf.git
...
walk 03d18e21d85fa30fc3ac8d921eb391e2a7bb242a
$

init-db

$ ssh git.alt init-db <path to directory>

Creates a new Git repo. By default, the repo is created in packages/ directory.

$ ssh git.alt init-db test
Initialized empty Git repository in ./
girar-init-db:	/people/dottedmag/packages/test.git

You can also pass a path and a name of the repo as the only parameter:

$ ssh git.alt init-db public/test
Initialized empty Git repository in ./
girar-init-db:	/people/dottedmag/public/test.git

mv-db

$ ssh git.alt mv-db <path to source directory> <path to destination directory>

Allows to move and rename repositories. If only a repository name is given (without path), packages/ directory is used.

Moving packages/test.git to public/newname.git:

$ ssh git.alt mv-db test public/newname
$

Moving public/newname.git to packages/test.git:

$ ssh git.alt mv-db public/newname test
$

Renaming packages/test.git to packages/megatest.git:

$ ssh git.alt mv-db test megatest
$

rm-db

$ ssh git.alt rm-db <path to git repository>

Removes a repository. If only a repository name is given (without path), packages/ directory is used:

$ ssh git.alt rm-db megatest # removes packages/megatest.git
$ ssh git.alt rm-db public/test

Auxiliary commands

charset
$ ssh git.alt charset <path to git repository> [<charset>]

Obtain or set the charset for raw-files of the specified git-repository. This is used by the git.alt web server to set the proper charset when a user downloads the file.

$ ssh git.alt charset packages/glibc
utf-8
$ ssh git.alt charset packages/glibc cp1252
$ ssh git.alt charset packages/glibc
cp1252
$
quota
$ ssh git.alt quota

Displays the user's quota and the used space.

$ ssh git.alt quota
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
     /dev/simfs   16932    977M   1465M             555    100k    150k        
$
git-receive-pack, git-upload-pack

These commands are used internally by git-push, git-pull and other utilities. You should not run them explicitly.

task, build

Not implemented yet.