.gitignored 文件仍然显示在 RStudio 中
.gitignored files still shown in RStudio
我将文件夹 .Rproj.user
添加到 .gitignore
。但是,其中包含的一些文件仍然显示(见屏幕截图)。我能做些什么吗?
更新
添加后无变化.Rproj.user/**
首先,您的文件已经提交,因此您必须将其从存储库中删除:
# 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 **
P.S.
这是一个很酷的挂钩,它会在您尝试将文件推送到服务器时阻止添加此类文件。
我将文件夹 .Rproj.user
添加到 .gitignore
。但是,其中包含的一些文件仍然显示(见屏幕截图)。我能做些什么吗?
更新
添加后无变化.Rproj.user/**
首先,您的文件已经提交,因此您必须将其从存储库中删除:
# 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 **
P.S.
这是一个很酷的挂钩,它会在您尝试将文件推送到服务器时阻止添加此类文件。