【发布时间】:2015-12-08 01:48:51
【问题描述】:
Github 应该用 "Executable File" 代替 ** lines(** sloc)
在将 shebang #!/usr/bin/env node 放入之后。相反,它会放入线条和 SLOC。我怎样才能说"Executable File"?
【问题讨论】:
Github 应该用 "Executable File" 代替 ** lines(** sloc)
在将 shebang #!/usr/bin/env node 放入之后。相反,它会放入线条和 SLOC。我怎样才能说"Executable File"?
【问题讨论】:
脚本中存在shebang 并不仅仅使文件“可执行”。这只是关于如何执行文件的说明。
您需要更改文件的模式以允许执行。
chmod +x {file}
git update-index --chmod=+x {file}
您也可以使用ls-files --stage查看文件的模式:
# before chmod
git ls-files --stage
100644 {commit} {length} {name}
# after chmod
git ls-files --stage
100755 {commit} {length} {name}
【讨论】: