How do I connect a COPY (an archive, not a clone) of a git repository to its remote?

半腔热情 提交于 2019-12-01 11:18:13
VonC

Don't do an archive: do a git bundle: that will give you one file, except you will be able to pull from it once copied in the remote location.

See more at "How can I email someone a git repository?"

That bundle can be incremental too (see also "Difference between git bundle and .patch").
Meaning you don't have to copy over the full repos, only the missing commits since the last backup.

I have a scripts which goes to all my bare repos and make a full backup once a week, incremental backups every day (if new commits are detected): sbin/save_bundles.


As Nevik Rehnel mentions in the comments, git archive would only save one revision, which would make any synchronization in the remote repo incomplete (missing intermediate commits).

Another approach is to tar the all repo, but that includes too much (including possible private sensitive files, or hook scripts). git bundle is the git way.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!