How to get files from git tab if rstudio

I doof and keep uploading .Rpoj, .Rbuildignore and .gitignore to github. Some of these files fight a local repo with another member of the project when they pull them out. I figured out how to fix this after I did this, but it includes this command line code:

git reset --hard (number of last good commit)
git push -f origin HEAD^:master

I prefer not to do this monkey business. Is there any way to remove these disgusting files from the windows of the git tab so that I don't accidentally download them. I don’t even know what to look for to find the answer.

Here is a screenshot of the files I need in my local repo, but you want to disappear from the git tab window in RStudio.

enter image description here

+5
source share
1 answer

Add the following lines to the file .gitignore:

.gitignore
.Rbuildignore
pacman.Rproj
+7
source

All Articles