在Git pull之后,文件显示为已删除

时间:2017-04-12 11:55:59

标签: git macos github bitbucket

这很奇怪......

在我对我的存储库的分支执行git pull并执行git状态后,我得到了这个:

On branch dev
Your branch is up-to-date with 'origin/dev'.
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

    deleted:    server/api/accounts/BankProvider/responses/wResponses.js
    deleted:    server/api/accounts/BankProvider/index.js
    deleted:    server/api/accounts/BankProvider/models/BorderlessModel.js
    deleted:    server/api/accounts/BankProvider/models/UserRegistrationModel.js
    deleted:    server/api/accounts/BankProvider/syeUtils.js
    deleted:    server/api/accounts/Transaction/TransactionResponses.js
    deleted:    server/api/accounts/models/borderModelJoi.js

no changes added to commit (use "git add" and/or "git commit -a")

在此之后,我做了一个:

git checkout .

要删除所有这些更改(我没做过),一切都很好,但是如果我转到另一个分支,任何分支,那么这些更改又会再次出现。 完整的过程如下:

➜  ms-accounts git:(dev) ✗ git status
On branch dev
Your branch is up-to-date with 'origin/dev'.
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        deleted:    server/api/accounts/BankProvider/responses/wResponses.js
        deleted:    server/api/accounts/BankProvider/index.js
        deleted:    server/api/accounts/BankProvider/models/BorderlessModel.js
        deleted:    server/api/accounts/BankProvider/models/UserRegistrationModel.js
        deleted:    server/api/accounts/BankProviderUtils.js
        deleted:    server/api/accounts/Transaction/TransactionResponses.js
        deleted:    server/api/accounts/models/borderModelJoi.js

no changes added to commit (use "git add" and/or "git commit -a")
➜  ms-accounts git:(dev) ✗ git checkout .
➜  ms-accounts git:(dev) git status
On branch dev
Your branch is up-to-date with 'origin/dev'.
nothing to commit, working tree clean
➜  ms-accounts git:(dev) git checkout qa && git checkout dev
Switched to branch 'qa'
Your branch is up-to-date with 'origin/qa'.
Switched to branch 'dev'
Your branch is up-to-date with 'origin/dev'.
➜  ms-accounts git:(dev) ✗ git status
On branch dev
Your branch is up-to-date with 'origin/dev'.
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        deleted:    server/api/accounts/BankProvider/responses/wResponses.js
        deleted:    server/api/accounts/BankProvider/index.js
        deleted:    server/api/accounts/BankProvider/models/BorderlessModel.js
        deleted:    server/api/accounts/BankProvider/models/UserRegistrationModel.js
        deleted:    server/api/accounts/BankProvider/Utils.js
        deleted:    server/api/accounts/Transaction/TransactionResponses.js
        deleted:    server/api/accounts/models/borderModelJoi.js

no changes added to commit (use "git add" and/or "git commit -a")

我认为提交存在问题,因为如果我们在其他计算机上执行此操作,它的行为方式相同。

如何删除这些已更改的文件?并将它们上传到仓库。

0 个答案:

没有答案