1

所以我尝试改变分支,我得到:

error: The following untracked working tree files would be overwritten by checkout:
env/local/include
    # many more files
env/local/lib
Please move or remove them before you can switch branches.
Aborting

所以我按照stackoverflow.com/ignoring-a-directory-from-a-git-repo-after-its-been-addedgit rm -r --cached .的建议尝试

我得到:

 fatal: pathspec 'env/' did not match any files

我尝试了其他各种途径。里面有没有文件?如果是这样,我怎样才能让 git 忽略它们?

谢谢

4

1 回答 1

1

git rm -r --cached . would work for files that you have added to the index.
But if you haven't added env/, you could consider add env/ and stash it (as in this question).

Other elements to be aware of:

于 2012-10-08T10:26:27.580 回答