最佳答案
首先,您的文件已经提交,因此您必须将其从存储库中删除:
# Once you add files to git, it will keep tracking them,
# so we have to delete them and commit your deletion
git rm -r --cached .Rproj.user/**
# Commit the deleted files
git commit -m "Removed files...."
# now add it to the `.gitignore` and the files will be ignored
echo '.Rproj.user/**' > .gitignore
您需要将其标记为文件夹。
为此,如上所述添加 2 **
附言
这是一个很酷的钩子(Hook),当您尝试将它们推送到服务器时,它会阻止要添加的那种文件。
What are some more forceful ways than a .gitignore to keep (force) files out of a repo?
关于r - .gitignored 文件仍然显示在 RStudio 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36185456/