From: Sverre Hvammen Johansen Date: Mon, 12 May 2008 06:40:53 GMT Subject: Re: how to backup git Message-ID: In-Reply-To: <4827DEF6.1050005@gmail.com> bill lam 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