Backup my git on Gitblit

762 views
Skip to first unread message

ronnie

unread,
Jan 12, 2016, 4:02:17 AM1/12/16
to gitblit
Hi everyone,

I am pretty new to Git and just managed to install gitblit to my users, does anyone knows the best way to backup the git repositories?

Can I just copy the whole directory? Or have to use the federation mentioned in gitblit website?

Ronnie

Glenn Matthys

unread,
Jan 12, 2016, 5:34:26 AM1/12/16
to gitblit
If you just want to backup the repositories, just copying the directories should do it, provided you can take a snapshot of the filesystem beforehand. Otherwise there might be changes while backing up. If you can't snapshot your filesystem, check out the "git bundle" command. A small script that loops through the repositories should do it then.

yong

unread,
Jan 12, 2016, 8:58:53 PM1/12/16
to git...@googlegroups.com
Thanks, will give it a try.
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "gitblit" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/gitblit/v5PQRammo6k/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> gitblit+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Jamey Graham

unread,
Jan 15, 2016, 10:29:39 AM1/15/16
to gitblit
Since your direct question has already been answered, I'll tangent a bit and ask "why do you think you need to back up in the first place?"  For those new to Git and _especially_ those who've been conditioned on centralized VCSs, it's not always easy understand the full ramifications (benefits) of a distributed VCS, one of which is that every clone of the repo is a complete clone - every clone is a backup! (although to fully restore "origin" you may need to have a couple of local repos push to it - but you can ALWAYS restore origin from local clones)

If you decide to still run backups, that's fine - but make sure you have a "right reason" for doing it and that it's based on DVCS principles.  You're not going to backup to restore to a point in time - VCSs obviously do that themselves; you may not want to backup for disaster recovery purposes, since recovering from local repos may be easier (you almost don't even need to try to recover...whenever the next person does a push from a local, it'll just recreate everything on origin automatically [well...sortof...everything in the history of the commit being pushed]).   

NOTE that the same argument doesn't apply to GitBlit config directory!!!

yong

unread,
Jan 15, 2016, 8:29:56 PM1/15/16
to git...@googlegroups.com

Thank you for the answer, it really clear my doubt!

--
Message has been deleted

Glenn Matthys

unread,
Jan 19, 2016, 2:24:18 AM1/19/16
to gitblit
I witnessed first-hand what a fire can do... You backup. Everything. YOU BACKUP EVERYTHING. Even with GIT or whatever versioning control system. No excuses.
Reply all
Reply to author
Forward
0 new messages