简体   繁体   中英

Ignore files in directory in GitHub Repository

I have created a repository. I've been using GitHub desktop and RStudio to version control my project.

The folder setup I've created is:

  • Master project. (r files)
  • data prep scripts (r functions)
  • input data (rds files used in the master script from the r functions)
  • output files (XLSX files from script)

First off, I created a .gitignore with the /input_data syntax.

When I went to check GitHub it is still tracking those .rds files. Is that the correct syntax to prevent tracking of the files in the input_data folder?

If so, how do I stop these files from being tracked?

you can add *.rds to your .gitignore

or use

git rm --cached  -- <files>

from the git console

I believe git is still tracking your files because you added the /input_data to the .gitignore file after you pushed everything on your github repo.

All you have to do is to tell git to stop tracking those files. From your terminal run:

git rm --cached <file name>

Then add the /input_data/* into your .gitignore file, commit and push everything to your repo.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM