简体   繁体   English

将 static 可执行文件上传到 GIT 项目会使文件损坏

[英]Uploading static executable to GIT project makes the file corrupted

I have a git project that has a number of python, js, etc files in it.我有一个 git 项目,其中包含许多 python、js 等文件。 One of the files is a compiled C program ('program.static') that runs fine in my project.其中一个文件是已编译的 C 程序(“program.static”),它在我的项目中运行良好。

However, when I commit that file to git (its rather small, like 12 MB) and then try to pull it down to a new machine (or even the same machine after wiping that local copy of the git project) the file no longer works as an executable.但是,当我将该文件提交到 git(它相当小,例如 12 MB),然后尝试将其拉到一台新机器(甚至是擦除 git 项目的本地副本后的同一台机器)时,该文件不再有效作为可执行文件。

On OSX, if I try to run the static file, (eg ./program.static ) it will just immediately kill the process.在 OSX 上,如果我尝试运行 static 文件(例如./program.static ),它会立即终止该进程。 If I copy/paste a local copy of program.static to the directory, it works fine.如果我将program.static的本地副本复制/粘贴到该目录,它可以正常工作。

How do you protect static files like this during the git commit/pull process?在 git commit/pull 过程中如何保护这样的 static 文件?

Changing the.attributes to include the.static file format correctly preserves functionality of the file更改 .attributes 以包含 .static 文件格式可正确保留文件的功能

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

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