Re: how to backup git

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



bill lam <cbill.lam <at> gmail.com> writes:

> Hello, this should be a simple question. How to backup a git repository but 
> excluding files that not under versioned?  If I cp or tar or rsync the 
> directory. All non-versioned files are added.

A repository can be backed up by backing up the .git directory.

If you want to back up the HEAD commit, use git-archive as follows:

  $ git archive --prefix=my-backup/ HEAD | gzip >my-backup.tar.gz

If you want to back up the working directory, commit it to a temporary branch
before you use 'git archive'.

-- 
Sverre Hvammen Johansen



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux