backup - How to protect folder containing a git history -
i'm using git keep track of writing projects , other personal work on own pc (running version of ubuntu).
although work being version controlled, worried might 1 day lose whole folder (containing .git file , work itself) mishap or technical failure.
what best way protect or work? (aside copying whole folder drive.)
you can work using git itself.
i might propose 3 ways that:
periodically repository pen drive:
- plug flash drive pc;
git init --bare
repository on it;add named remote in main repository:
git remote add --mirror=push pendrive /media/that_drive_id
that
--mirror=push
command-line option ensure simple callgit push pendrive
suffice push everything pushable.back repository there using like
git push pendrive
unmount drive.
the next time up, plug drive do
git push pendrive
another option use
git-bundle
command might used export whole repository (with history) single file can copied off external storage.this approach looks superficially simpler former simplicity comes @ cost:
- no incremental backups: while
git-bundle
can used export specific parts of history, must keep backed last time somewhere, , inconvenient , error prone. - if repository grows big, each "bundling" create big file.
- no incremental backups: while
unless stuff private (like passwords) buy private hosting plan git provider , mirror repository there.
mirroring set in same way pendrive approach, git url different.
i pendrive approach best.
Comments
Post a Comment