Git Magic. Глава 4. Все о клонировании.

Ben Lynn, “Git Magic. Chapter 4. Cloning Around”, public translation into Russian from English More about this translation.

See also 19 similar translations

Translate into another language.

Participants

vixus746 points
Natamile234 points
mifistor49 points
And others...
Join Translated.by to translate! If you already have a Translated.by account, please sign in.
If you do not want to register an account, you can sign in with OpenID.
Pages: ← previous Ctrl next
1 2 3

Git Magic. Chapter 4. Cloning Around

Git Magic. Глава 4. Все о клонировании.

History of edits (Latest: vixus 2 years, 7 months ago) §

— Уважаемые коллеги, я создал открытый репозиторий gitmagic-ru, куда складываю готовые главы. http://github.com/mifistor/gitmagic-ru Если Вы хотите получить права на запись в репозиторий свяжитесь со мной mifistor@gmail.com Вы можете скачать и посмотреть черновик: http://files.getdropbox.com/u/281916/... mifistor

== Cloning Around ==

=== Все о клонировании ===

History of edits (Latest: vixus 2 years, 7 months ago) §

In older version control systems, checkout is the standard operation to get files. You retrieve a bunch of files in the requested saved state.

В старых системах контроля версий, checkout - это стандартная операция для получения файлов. Вы получаете файлы в нужном сохраненном состоянии.

History of edits (Latest: natalius 2 years, 7 months ago) §

In Git and other distributed version control systems, cloning is the standard operation. To get files you create a clone of the entire repository. In other words, you practically mirror the central server. Anything the main repository can do, you can do.

В Git и других распределенных системах контроля версий, клонирование - это обычно дело. Для получение файлов вы создаете клон всего репозитария. Другими словами, вы создаете зеркало центрального сервера. При это все что можно делать в основном репозитарии, можно делать и в локальном.

History of edits (Latest: Natamile 2 years, 7 months ago) §

=== Sync Computers ===

=== Синхронизация компьютеров ===

History of edits (Latest: vixus 2 years, 7 months ago) §

This is the reason I first used Git. I can tolerate making tarballs or using *rsync* for backups and basic syncing. But sometimes I edit on my laptop, other times on my desktop, and the two may not have talked to each other in between.

По этой причине я начал использовать Git. Я вполне приемлю синхронизацию архивами или использование *rsync* для бэкапа или процедуры стандартной синхронизации. Но я работаю то на ноутбуке, то на стационарном компьютере, которые никак между собой не взаимодействуют.

History of edits (Latest: mifistor 2 years, 7 months ago) §

Initialize a Git repository and commit your files on one machine. Then on the other:

Инициализируйте Git репозиторий и делайте коммит файлов на одном компьютере. А потом выполните следующие операции на другом:

History of edits (Latest: natalius 2 years, 7 months ago) §

$ git clone other.computer:/path/to/files

$ git clone other.computer:/path/to/files

History of edits (Latest: vixus 2 years, 7 months ago) §

to create a second copy of the files and Git repository. From now on,

для создания второй копии файлов и Git репозитария. С этого момента выполняйте,

History of edits (Latest: mifistor 2 years, 7 months ago) §

— From now on - с этого момента выполняйте:  Natamile

$ git commit -a

$ git commit -a

History of edits (Latest: vixus 2 years, 7 months ago) §

$ git pull other.computer:/path/to/files HEAD

$ git pull other.computer:/path/to/files HEAD

History of edits (Latest: vixus 2 years, 7 months ago) §

will pull in the state of the files on the other computer into the one you're working on. If you've recently made conflicting edits in the same file, Git will let you know and you should commit again after resolving them.

это синхронизирует состояние ваших файлов с состоянием файлов другого компьютера. Если вы внесли изменения, которые будут конфликтовать с таким же файлом, Git даст Вам знать об этом, и вам придется сделать коммит еще раз, уже после устранения конфликтующих изменений.

History of edits (Latest: Natamile 2 years, 7 months ago) §

=== Classic Source Control ===

=== Классический контроль исходного кода ===

History of edits (Latest: vixus 2 years, 7 months ago) §

Initialize a Git repository for your files:

Инициализируйте Git-репозитарий для ваших файлов:

History of edits (Latest: mifistor 2 years, 7 months ago) §

$ git init

$ git init

History of edits (Latest: vixus 2 years, 7 months ago) §

$ git add .

$ git add .

History of edits (Latest: vixus 2 years, 7 months ago) §

$ git commit -m "Initial commit"

$ git commit -m "Initial commit"

History of edits (Latest: vixus 2 years, 7 months ago) §

On the central server, initialize an empty Git repository with some name,

На центральном сервере инициализируйте пустой Git-репозитарий с присвоением какого-нибудь имени,

History of edits (Latest: Natamile 2 years, 7 months ago) §

and start the Git daemon if necessary:

и запустите Git-демон, если необходимо:

History of edits (Latest: Natamile 2 years, 7 months ago) §

$ GIT_DIR=proj.git git init

$ GIT_DIR=proj.git git init

History of edits (Latest: vixus 2 years, 7 months ago) §

$ git daemon --detach # it might already be running

$ git daemon --detach # возможно уже запущен

History of edits (Latest: mifistor 2 years, 7 months ago) §

— it might already be running - возможно, уже запущен  Natamile

Some public hosts, such as http://repo.or.cz[repo.or.cz], will have a different method for setting up the initially empty Git repository, such as filling in a form on a webpage.

Публичные репозитарии, такие как http://repo.or.cz[repo.or.cz], имеют собственные схемы по организации изначально пустых Git-репозитариев, которые обычно предполагают регистрацию и заполнение формы.

History of edits (Latest: Natamile 2 years, 7 months ago) §

Push your project to the central server with:

Чтобы сохранить ваши изменения в центральный репозиторий, запустите:

History of edits (Latest: mifistor 2 years, 7 months ago) §

— а можно так - чтобы слить изменения с локального репозитария на центральный сервер, запустите:...? Natamile

$ git push git://central.server/path/to/proj.git HEAD

$ git push git://central.server/path/to/proj.git HEAD

History of edits (Latest: vixus 2 years, 7 months ago) §

We're ready. To check out source, a developer types

Для клонирования, как уже было описано выше, необходимо:

History of edits (Latest: vixus 2 years, 7 months ago) §

— наверно, это верно по смыслу, но в оригинале написано - теперь все готово. Чтобы проверить источник, разработчик набирает Natamile

$ git clone git://central.server/path/to/proj.git

$ git clone git://central.server/path/to/proj.git

History of edits (Latest: vixus 2 years, 7 months ago) §

After making changes, the code is checked in to the main server by:

После внесения изменений, код записывается на главный сервер с помощью:

History of edits (Latest: Natamile 2 years, 7 months ago) §

$ git commit -a

$ git commit -a

History of edits (Latest: vixus 2 years, 7 months ago) §

$ git push

$ git push

History of edits (Latest: vixus 2 years, 7 months ago) §

If the main server has been updated, the latest version needs to be checked out before the push. To sync to the latest version:

Если в ходе работы на сервере уже происходили изменения, необходимо обновить локальную копию репозитария перед сохранением собственных изменений. Для синхронизации:

History of edits (Latest: Natamile 2 years, 7 months ago) §
Pages: ← previous Ctrl next
1 2 3

License: GNU General Public License version 3