openstack源代码在windows中的问题

在windows下,使用 git clone 了 openstack 的代码:

git clone https://github.com/openstack/nova.git

git clone https://github.com/openstack/keystone.git

git clone https://github.com/openstack/glance.git

这时,没有修改任何东西,git status却报告有很多修改:

 

 

C:\Users\refactor\git\keystone>git status
# On branch master
# Your branch is ahead of ‘origin/master’ by 1 commit.
#
# Changes not staged for commit:
# (use “git add <file>…” to update what will be committed)
# (use “git checkout — <file>…” to discard changes in working directory)
#
# modified: bin/keystone-all
# modified: bin/keystone-manage
# modified: run_tests.sh
# modified: tools/convert_to_sqlite.sh
# modified: tools/sample_data.sh
# modified: tools/with_venv.sh
#
no changes added to commit (use “git add” and/or “git commit -a”)

 

使用 git diff 发现:

C:\Users\refactor\git\keystone>git diff
diff –git a/bin/keystone-all b/bin/keystone-all
old mode 100755
new mode 100644
diff –git a/bin/keystone-manage b/bin/keystone-manage
old mode 100755
new mode 100644
diff –git a/run_tests.sh b/run_tests.sh
old mode 100755
new mode 100644
diff –git a/tools/convert_to_sqlite.sh b/tools/convert_to_sqlite.sh
old mode 100755
new mode 100644
diff –git a/tools/sample_data.sh b/tools/sample_data.sh
old mode 100755
new mode 100644
diff –git a/tools/with_venv.sh b/tools/with_venv.sh
old mode 100755
new mode 100644

 

在这种情况下,无法正常进行 git 的操作(pull, commit等)。解决办法是:

git config core.filemode false

 

参见:

http://stackoverflow.com/questions/1580596/how-do-i-make-git-ignore-mode-changes-chmod

 

此条目发表在OpenStack分类目录,贴了, 标签。将固定链接加入收藏夹。