Redian新闻
>
用git来备份重要文件怎样
avatar
用git来备份重要文件怎样# Hardware - 计算机硬件
z*e
1
像gitlab这种,一个repo可以放10gb
有什么明显的优缺点吗
avatar
F*Q
2
I have been using git to manage my core files (almost everything, except
pictures, downloads, and big data files) since 2010. really happy that I
made that choice.
My repository (bare) has grown from from 3GB to 8GB (you will be surprised
how slow your real creations grow once you start organizing your files).
Once you checkout a copy, the total git folder is about 2x of the bare repo
size - to me, is about 16 GB plus un-tracked files (mostly those do not
worth version control).
There are a few noticeable benefits using a git to manage your files
1. apparent, you have everything - every file change, every history etc, you
can go back and forth anywhere, any time.
2. your data are naturally backed up - every computer with a working git
folder is a self-contained complete copy of your files; you will never be
afraid of losing your data again.
3. blazing fast! git is designed to work with large projects. It is almost
effortless to manage my 8GB repo (60k files). The only thing you will need
is to make sure your git folder is located on an SSD! On my laptop, a "git
status" takes less than a second.
4. apparently, you also get all the benefits of git - branching, merging,
tagging, diff-ing, ...
There were some learning curves, but after practicing, you will like the way
it is. My repos are stored on Linux, Mac and Windows (use TortoiseGit).
Once you set up the repo, and smooth the wrinkles (such as setting up the
newline/file permissions), it is smooth sail afterwards.
avatar
d*n
3
馊主意:
1. repo会很大,每次回滚都是zip/unzip
2. binary没法diff
3. lfs问题多多

【在 z*********e 的大作中提到】
: 像gitlab这种,一个repo可以放10gb
: 有什么明显的优缺点吗

avatar
F*Q
4

by the way, you don't need a gitlab/github to use git. those are just web
interfaces. you can convert any folder on your disk to a git repository!
here is how I did mine, first, find a server (a machine you use to exchange
data) that runs an ssh server, use
mkdir gitreponame
cd gitreponame
git --bare init
to create a bare repository, then from any other machine, you clone a copy
from this bare repo by
git clone ssh://youraccount:myserve.com:/path/to/gitreponame gitrepo
then you do your git stuff, after you are done, run "git commit" and "git
push". That will upload your changes to the bare repo. Then, another machine
can checkout the latest changes from the bare repo by "git pull". that's it
.

【在 z*********e 的大作中提到】
: 像gitlab这种,一个repo可以放10gb
: 有什么明显的优缺点吗

avatar
F*Q
5

no way. you can git checkout to any past hash
I don't care. why would I diff a binary?
this is git, not LFS!

【在 d****n 的大作中提到】
: 馊主意:
: 1. repo会很大,每次回滚都是zip/unzip
: 2. binary没法diff
: 3. lfs问题多多

avatar
j*2
6
不咋样,git删掉的文件还在历史commit里面,时间长了仓库目录会非常大。看着不断
增长的目录,慢慢会有一种无力感

【在 z*********e 的大作中提到】
: 像gitlab这种,一个repo可以放10gb
: 有什么明显的优缺点吗

avatar
j*2
7
个人感觉最完美的备份方式是zfs snapshot,省心省力

【在 z*********e 的大作中提到】
: 像gitlab这种,一个repo可以放10gb
: 有什么明显的优缺点吗

avatar
n*u
8
大量小文件的话,git很好。
小量大文件的话,resilio sync这些比较好,torrent是把大文件分块来同步的,小改
动不需要更新整个文件。
傻瓜方法就是花点钱dropbox。
avatar
t*g
9
dropbox可以免费弄成25G啊
avatar
z*e
10
zfs除了freenas,个人用户很难用到吧

【在 j********2 的大作中提到】
: 个人感觉最完美的备份方式是zfs snapshot,省心省力
avatar
z*e
11
我想主要是文档这类,更新比较快,文件也不大,打算搞个repo专门放,照片视频什么
的用nas+外置硬盘就好了,一个月整理一次

【在 n*********u 的大作中提到】
: 大量小文件的话,git很好。
: 小量大文件的话,resilio sync这些比较好,torrent是把大文件分块来同步的,小改
: 动不需要更新整个文件。
: 傻瓜方法就是花点钱dropbox。

avatar
F*Q
12

git runs "git gc" whenever it feels necessary. the .git folder keeps pretty
much the same size as your working folder.
there are many ways to permanently purge deleted files, you can use git
filter-branch, git rebase, or bfg
http://stackoverflow.com/questions/307828/completely-remove-file-from-all-git-repository-commit-history
https://rtyley.github.io/bfg-repo-cleaner/

【在 j********2 的大作中提到】
: 不咋样,git删掉的文件还在历史commit里面,时间长了仓库目录会非常大。看着不断
: 增长的目录,慢慢会有一种无力感

avatar
E*r
13
用群辉那个 cloud station drive
同步到自己 nas 的一个 shared folder
让那个 shared folder 自动做 btrfs snapshots 就好了
自己设置 retention policy
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。