# Re: how-to "backup" a repository

5 messages from 2006-11-06 to 2006-11-06. Participants: Shawn Pearce, Wink Saville, Junio C Hamano.
Thread: https://gitlist.dev/t/43404

## Wink Saville, 2006-11-06 05:46

Subject: how-to "backup" a repository
Message-ID: <454ECC23.6010503@saville.com>
URL: https://gitlist.dev/e/454ECC23.6010503%40saville.com

```
Hello,

I've been working with git for a little while, but still very
much a neophyte. One thing I'd like to do is be able to backup
my work on a server located on my network.

Currently I have cloned the Linux 2.6 tree on my personal computer
and have been backing it up by tar'ing the subdirectory with the
cloned repository and then using scp to copy it to my server.

I suspect there is a better way, probably using git itself:)

How is the typically handled?

Cheers,


```

## Shawn Pearce, 2006-11-06 05:52

Subject: Re: how-to "backup" a repository
Message-ID: <20061106055224.GA23126@spearce.org>
URL: https://gitlist.dev/e/20061106055224.GA23126%40spearce.org
In-Reply-To: <454ECC23.6010503@saville.com>

```
Wink Saville <wink@saville.com> wrote:
> I've been working with git for a little while, but still very
> much a neophyte. One thing I'd like to do is be able to backup
> my work on a server located on my network.
> 
> Currently I have cloned the Linux 2.6 tree on my personal computer
> and have been backing it up by tar'ing the subdirectory with the
> cloned repository and then using scp to copy it to my server.
> 
> I suspect there is a better way, probably using git itself:)
> 
> How is the typically handled?

Create a remote (in .git/remotes) which refers to your backup
location.  Then use 'git push' to push your branch(es) of
interest to the backup.

-- 

```

## Wink Saville, 2006-11-06 06:13

Subject: Re: how-to "backup" a repository
Message-ID: <454ED27F.8060106@saville.com>
URL: https://gitlist.dev/e/454ED27F.8060106%40saville.com
In-Reply-To: <20061106055224.GA23126@spearce.org>

```
Shawn Pearce wrote:
> Wink Saville <wink@saville.com> wrote:
>> I've been working with git for a little while, but still very
>> much a neophyte. One thing I'd like to do is be able to backup
>> my work on a server located on my network.
>>
>> Currently I have cloned the Linux 2.6 tree on my personal computer
>> and have been backing it up by tar'ing the subdirectory with the
>> cloned repository and then using scp to copy it to my server.
>>
>> I suspect there is a better way, probably using git itself:)
>>
>> How is the typically handled?
> 
> Create a remote (in .git/remotes) which refers to your backup
> location.  Then use 'git push' to push your branch(es) of
> interest to the backup.
> 

Shawn,

This sounds easy enough, but how-to "create a remote"?
I looked in .git/remotes and see origin which contains:

URL: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Pull: refs/heads/master:refs/heads/origin

But where is the syntax defined?

Also, how do I setup git on my server so that it becomes a server?

Sorry for are naive questions, but looking at my git tree and
the Internet didn't turn up any obvious answers. Hopefully you can
point to the appropriate documents.

Thanks,

Wink


```

## Shawn Pearce, 2006-11-06 06:18

Subject: Re: how-to "backup" a repository
Message-ID: <20061106061846.GB23126@spearce.org>
URL: https://gitlist.dev/e/20061106061846.GB23126%40spearce.org
In-Reply-To: <454ED27F.8060106@saville.com>

```
Wink Saville <wink@saville.com> wrote:
> This sounds easy enough, but how-to "create a remote"?
> I looked in .git/remotes and see origin which contains:
> 
> URL: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
> Pull: refs/heads/master:refs/heads/origin
> 
> But where is the syntax defined?

See http://www.kernel.org/pub/software/scm/git/docs/git-push.html#URLS
 
> Also, how do I setup git on my server so that it becomes a server?

So long as you can ssh to it and Git is installed in your PATH then
there's nothing else to do; Git will login via SSH and execute Git
on the remote side to run the server.

-- 

```

## Junio C Hamano, 2006-11-06 06:21

Subject: Re: how-to "backup" a repository
Message-ID: <7vfycxf63k.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vfycxf63k.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <454ED27F.8060106@saville.com>

```
Wink Saville <wink@saville.com> writes:

> This sounds easy enough, but how-to "create a remote"?
> I looked in .git/remotes and see origin which contains:
>
> URL: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
> Pull: refs/heads/master:refs/heads/origin
>
> But where is the syntax defined?

man git-push -- where else ;-)?

http://www.kernel.org/pub/software/scm/git/docs/git-push.html


```
