I'm very new to GitHub and am not super experienced in R yet, and I've created a GitHub repository for a class project and it was all going well, but commits like these keep popping up in my Git pane in RStudio, and I have no idea where they are coming from. Attached is a screenshot of what they look like.
I've tried everything ChatGPT has told me to do but I'm just not experienced enough to figure out why even that won't solve it.
those are not really commits but tracked changes in your git-repo. That is exactly what git
is supposed to do. It is up to you now to decide what you want to do with these changes (commit, revert, ignore, ...).
You can fix this by changing the .gitignore
-file. You can simply copy the contents from here which is optimized for R
: https://github.com/github/gitignore/blob/main/R.gitignore
Or you can add this to fix the problems from your screenshot:
# RStudio files
.Rproj.user/