简体   繁体   English

Git版本控制某些文件

[英]Git version control certain files

1000% certain there is a question about it, I just have no idea how I should google it. 1000%肯定有关于它的问题,我只是不知道我应该如何搜索它。

The problem. 问题。

I'd like git to grab the files I commit, but only control the version of some of the files (snippets, scripts and json configs), I would like git to grab .dll libraries and other stuff, but since they are binary, git will literally copy binary files and take up big portion of the space in repo, I don't want git to do that. 我想git抓取我提交的文件,但只控制某些文件的版本(代码段,脚本和json配置),我想git抓取.dll库和其他内容,但是由于它们是二进制文件, git会从字面上复制二进制文件并在回购中占据很大一部分空间,我不希望git那样做。

For example. 例如。 I have 我有

  • Script.cs Script.cs
  • Config.json Config.json
  • SystemLib.cs SystemLib.cs
  • Library_ver1.2.dll Library_ver1.2.dll

If I was to update Library to version 1.3, git will store ver1.2 and ver1.3. 如果我要将Library更新到版本1.3,则git将存储ver1.2和ver1.3。 Lib I don't literally care about, so I only want it to be stored, not versioned. Lib我实际上并不关心,所以我只希望将其存储而不是版本化。 I only want git to version control *.cs and *.json files in this example. 在此示例中,我只希望git对* .cs和* .json文件进行版本控制。

感谢ElpieKay,我研究了LFS,它确实满足了我的要求,因此解决了这个问题。

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

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