From a66b89c131b55f304ca4e66ba9fa289c71b848d0 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 15 Aug 2013 01:46:11 +0200 Subject: creating an origin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- using-git.texinfo | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/using-git.texinfo b/using-git.texinfo index 7373706..4388f0b 100644 --- a/using-git.texinfo +++ b/using-git.texinfo @@ -61,6 +61,7 @@ Texts. A copy of the license is included in the section entitled @menu * Create a repository:: +* Create an origin:: @end menu @@ -131,6 +132,42 @@ git commit -n 'first commit' +@node Create an origin +@section Create an origin + +It is a good idea to create a backup repostory, +so you do not lose your work on a disc failure, +filesystem corruption accidental removal. + +You can such repostory for allowing collaboration +with a command repository that the collaborators +can all submit and fetch commits from. + +This repository is customarly called `origin'. +And it is a bare repository, meaning that it +only hold the data in the @file{.git} directory +and cannot be used as the working directory. + +@example +mkcd -p /srv/git/MY_REPOSITORY.git +cd /srv/git/MY_REPOSITORY.git +git init --bare + +cd - # Go back to your project respository +git remote add origin file:///srv/git/MY_REPOSITORY.git +git push -u orgin master # master is the bransh you are working in +@end example + +It is standard to append @file{.git} to the +end of the repository name when it is bare. + +To submit your changes to origin you can now +use the command @command{git push}. To fetch +updates others have made, use the command +@command{git pull}. + + + @node GNU Free Documentation License @appendix GNU Free Documentation License @include fdl.texinfo -- cgit v1.2.3-70-g09d2