Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 23080 программистов и 1587 роботов. Сейчас ищут 1724 программиста ...

Initialize a new repository

Вернуться к: Tutorial

The VersionControl_Git class represents your Git repository.

You should specified a path to repository to VersionControl_Git.

<?php
require_once 'VersionControl/Git.php';

// Specify a directory
$git = new VersionControl_Git('/path/to/repository');

Do you want to create new repository? It is easy.

First, create an instance of VersionControl_Git and pass a directory what you want to create new Git repository.

Next, call the VersionControl_Git::initRepository() method.

<?php
require_once 'VersionControl/Git.php';

// Specify a directory
$git = new VersionControl_Git('/path/to/repository');

// create new repository
$git->initRepository();

// If you want to create bare repository, pass true as the first argument
$git->initRepository(true);

Do you want to create clone repository? In this case, you can use the VersionControl_Git::createClone()

<?php
require_once 'VersionControl/Git.php';

// Specify a directory
$git = new VersionControl_Git('/path/to/repository');

// create new repository
$git->createClone('http://example.com/repository.git');

// If you want to create bare repository, pass true as the second argument
$git->createClone('http://example.com/repository.git'true);

Now, you've readied to use full futures of VersionControl_Git.



Вернуться к: Tutorial

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware