[英]Git: Move specific files from one branch in one repository to another branch in another repository
We have 1000s of autocad drawing files in, let's say Repo A, Branch1. 我们有1000个autocad绘图文件,比如Repo A,Branch1。 Also, it contains other files.
此外,它还包含其他文件。 We pull this repository and after some steps, they are pushed to Repo B, Branch 2. The cumulative size is around 2GB and it takes lot of time to pull Repo A and commit to Repo B.
我们拉出这个存储库,经过一些步骤后,它们被推送到Repo B,Branch 2.累积大小约为2GB,需要大量时间来提取Repo A并提交Repo B.
My questions are 1. Is there a way to copy, not move, the latest commit in Repo A Branch1 to Repo B Branch 2, in a lesser span of time? 我的问题是1.有没有办法在较短的时间内复制,而不是移动Repo A Branch1中的最新提交到Repo B Branch 2? 2. Would like to copy only the specific file types, not all the files.
2.只想复制特定的文件类型,而不是所有文件。
Since I assume the files you are committing are of a binary type, then no, I don't believe there are any shortcuts from Git's perspective here. 因为我假设您提交的文件是二进制类型,然后不,我不相信Git的观点有任何捷径。
A commit in Git is a defined unit and cannot be broken up...if it was broken up then it would need a new identifier (sha) since they are generated based on the content of the commit plus it's parent commit. Git中的提交是一个已定义的单元,不能被分解......如果它被分解,那么它将需要一个新的标识符(sha),因为它们是根据提交的内容加上它的父提交生成的。
The only option I can think of would be to check in your files using some type of compression but that would be abstracted away from Git's perspective. 我能想到的唯一选择是使用某种类型的压缩来检查你的文件,但这将从Git的角度抽象出来。
Also, Git may not be the best tool for this type of storage. 此外,Git可能不是这种类型的存储的最佳工具。 While Git can handle binary files it is mostly tailored towards storing text files that can be efficiently diffed.
虽然Git可以处理二进制文件,但它主要用于存储可以有效区分的文本文件。
如果repo B的主机可以访问repo A的主机,那么你可以在B上设置一个遥控器,这样你就可以直接将A的变化拉到B.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.