Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.gitignored files still shown in RStudio

Tags:

git

r

rstudio

I added the folder .Rproj.user to .gitignore. However, some files contained in it still show up (see screenshot). Any ideas what can I do about it?

enter image description here

Update

No changes after adding .Rproj.user/**

enter image description here

like image 746
Mark Heckmann Avatar asked Nov 17 '25 02:11

Mark Heckmann


1 Answers

First of all your files are already committed so you have to remove it from the repo:

# 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

You need to mark it as folder.
In order to do so add the 2 ** as described above

enter image description here

P.S.

Here is a cool hook which will block that kind of files to be added when you try to push them to the server.

What are some more forceful ways than a .gitignore to keep (force) files out of a repo?

like image 83
CodeWizard Avatar answered Nov 18 '25 20:11

CodeWizard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!