我只是git的用户,而不是管理员。我最近将一个项目克隆到一个空目录中。克隆后,我注意到已经进行了分阶段修改。
以下是我执行顺序中的步骤。
1-创建一个空目录
# mkdir /tmp/my-git-folder ; cd /tmp/my-git-folder
2-在新的EMPTY目录中克隆一个项目。
# git clone ssh://git@server.com:8011/foo/bar.git
Cloning into 'bar'...
remote: Counting objects: 32736, done.
remote: Compressing objects: 100% (9759/9759), done.
remote: Total 32736 (delta 20650), reused 31854 (delta 20171)
Receiving objects: 100% (32736/32736), 5.14 MiB | 815.00 KiB/s, done.
Resolving deltas: 100% (20650/20650), done.
现在这应该是一个全新副本,完全没有任何更改。但是当我执行git status
时,就是这样。
3-选中git status
On branch master
Your branch is up to date with 'origin/master'.
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: some-folder/ansible-tasks.yml
no changes added to commit (use "git add" and/or "git commit -a")
但是我从来没有做过任何改变。我试图进行清洁以及重置。但是这种变化不会消失,我也无法获得完整的副本。
# git checkout .
# git status
On branch master
Your branch is up to date with 'origin/master'.
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: some-folder/ansible-tasks.yml
no changes added to commit (use "git add" and/or "git commit -a")
# git reset
Unstaged changes after reset:
M some-folder/ansible-tasks.yml
# git clean -f
# git status
On branch master
Your branch is up to date with 'origin/master'.
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: some-folder/ansible-tasks.yml
no changes added to commit (use "git add" and/or "git commit -a")
由于我对这里的错误有任何想法,因此任何帮助将不胜感激。