如何检入我的文件是否在repo

时间:2015-12-24 08:30:21

标签: git

以下是我在下面尝试设置可执行权限并在我的本地仓库中推送代码的命令:

ls -l post.py

-rw-r--r-- 1 xxxxx xxxxx     2 Dec 24 00:04 post.py

git add post.py
git commit -am "Commit Change"
..............................
create mode 100644 post.py

git update-index --chmod=+x post.py
git commit -am "update file permission"

git push

步骤是否正确 - 因为在我的快照中我没有看到文件权限为755但仍然是644?

在我推送到我的仓库之后,我在一个单独的位置重新克隆它,并看到文件post.py仍然将文件权限设置为644(-rw-r - r--)而不是755( - rwxr-XR-x)的

因为只有在OS文件级别上设置了可执行位之后才能执行我的脚本:

./post.dy

1 个答案:

答案 0 :(得分:1)

首先设置git来跟踪process.kill()更改

chmod

现在再做一次你做的事情:

git config core.filemode true

提交更改

git update-index --chmod=+x post.py

并确认您现在可以看到git commit -m "update file permission" [master 77b171e] Changing file permissions 0 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 post.py 更改。