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 call git 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.
  • 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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -