Hi Shawn, Sorry to ask again, but I'm a little confuse about how git work in my case. I use gitosis on a server where I have all repos (/usr/local/git/repositories/), so different people clone their repos on their computers. What I want is to backup, on gitosis server, all repos in /backups/git/repositories/ after every commit. So, my questions are: Do I have to run these two comands on tha gitosis server? Or on a remote computer? git --git-dir=/backup/project.git init git remote add --mirror backup /backup/project.git The post-commit are execute on gitosis server or on the remote pc? I'm completely new using git so I'm a little confuse.. sorry for asking again. thanks a lot. regards Israel. On 10/12/09, Shawn O. Pearce <spearce@xxxxxxxxxxx> wrote: > Israel Garcia <igalvarez@xxxxxxxxx> wrote: >> That's OK, but I want to backup my git repo locally > > Just change the path of the backup remote (that final argument to > git remote add) to point to the local directory. > > Though I guess you would also need to run git init there, e.g.: > > git --git-dir=/backup/project.git init > git remote add --mirror backup /backup/project.git > > # and create the hook as below > > Of course, backup to another folder on the same disk isn't a backup > at all, the disk can still fail and lose both repositories. > >> On 10/12/09, Shawn O. Pearce <spearce@xxxxxxxxxxx> wrote: >> > Israel Garcia <igalvarez@xxxxxxxxx> wrote: >> >> Which is the simplest way to backup a git repository after every >> >> commit? >> > >> > Add a commit hook to push to another location, e.g.: >> > >> > git remote add --mirror backup you@xxxxxxxxxxxx:path/to/backup.git >> > >> > cat >.git/hooks/post-commit >> > #!/bin/sh >> > git push backup >> > ^D >> > >> > chmod a+x .git/hooks/post-commit > > -- > Shawn. > -- Regards; Israel Garcia -- 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