简体   繁体   English

使用git进行Web部署-如何仅在检出的实时站点中拥有大型二进制文件,而不是git repo中的blob

[英]Web deployment with git - how to have large binaries only in checked-out live site, and not as blobs in git repo

I am using git to deploy a website. 我正在使用git部署网站。 The webserver contains a bare repository (the hub) and a cloned repo with a checked-out working tree (which is the actual live site). 该网络服务器包含一个裸仓库(中心)和一个带检出工作树的克隆存储库(这是实际的活动站点)。 I am working locally and pushing to the hub, and a post-receive hook at the hub pulls the changes into the live repo. 我正在本地工作并推向集线器,集线器上的接收后挂钩将所做的更改拉入实时回购中。

The site contains a huge archive with tons of PDF files (several gigs). 该站点包含一个巨大的存档,其中包含大量的PDF文件(数个演出)。 Currently these are not managed with git, but are instead synced using other tools which unfortunately do not work properly. 当前,这些不是使用git管理的,而是使用其他不幸无法正常工作的工具进行同步。 I would like to manage everything with git, but due to space constraints I want the files to exist only in the working trees, and not in the git repository (which would double the required size locally and triple it at the webserver as objects in both the hub repo and the live site repo). 我想用git管理所有内容,但是由于篇幅所限,我希望文件仅存在于工作树中,而不存在于git存储库中(这会将本地所需大小加倍,并在Web服务器上将其作为对象同时存储三倍)集线器存储库和实时站点存储库)。 In other words, I want to sync these files directly from my local computer to the live working tree. 换句话说,我想将这些文件直接从本地计算机同步到活动的工作树。 I do not need versioning of these files. 我不需要这些文件的版本控制。

Is this possible? 这可能吗? I have tried to look into git-fat, but when doing git fat push, it only pushes SHA-named objects into a single directory. 我尝试研究git-fat,但是在执行git fat push时,它仅将SHA命名的对象推入单个目录中。 I would like to sync the entire PDF archive folder structure, just without keeping the PDF files themselves in the actual git repo (.git/objects). 我想同步整个PDF存档文件夹结构,而无需将PDF文件本身保留在实际的git repo(.git / objects)中。

I am using Windows locally. 我在本地使用Windows。 My webserver is running Linux. 我的网络服务器正在运行Linux。 I do not think I have permissions to install anything on the server. 我认为我没有权限在服务器上安装任何东西。

git-media is a tool that seems to help in this situation. git-media是一种在这种情况下可能会有所帮助的工具。 It will transfer the media-files using a specified transfer method (scp seems the most appropriate in this case). 它将使用指定的传输方法传输媒体文件(在这种情况下,scp似乎最合适)。

When staging files, the files will be copied to a temporary buffer, untill you sync them (git media sync). 暂存文件时,文件将被复制到临时缓冲区,直到您同步它们(git media sync)为止。 It will sync them to a specified directory, which could be your the working tree on the server. 它将它们同步到指定的目录,该目录可以是服务器上的工作树。

git-media has already been mentioned, and the other canonical answer is git-annex ( http://git-annex.branchable.com/ ). git-media已经被提及,另一个典型的答案是git-annex( http://git-annex.branchable.com/ )。 In particular, the subpage "what git-annex is not" ( http://git-annex.branchable.com/not/ ) is worth perusing. 特别值得一提的是“什么不是git-annex”子页面( http://git-annex.branchable.com/not/ )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM