Home > Mobile >  What is the purpose of saved* command in a .gitignore file?
What is the purpose of saved* command in a .gitignore file?

Time:08-12

Following the .gitignore file in one of my research project built in python I have noticed the saved* command but I couldn't relate the purpose of it from that project directory.

Here're the commands in the .gitignore file:

*.pyc

.ipynb_checkpoints

saved*

Now, I could make out the first two commands but why is actually the saved* command used for in a certain .gitignore file?

Is it for blocking any newly created directories and treating them as unversioned files in the project folder ??

CodePudding user response:

If you have any directories OR files that have names starting with 'saved' then they would be blocked from getting versioned/included in the git repo. The '*' is a wildcard, so it is looking for the string 'saved' with or without any characters in the name after that, and ignoring those files/paths from getting included when you run git commands.

There doesn't necessarily have to be a file or directory named that....but as wkl indicated in the comments, someone likely created a path like that to copy files to but didn't want them to get committed to the repository, so they added that to the .gitignore file.

See: https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files for more info on how to use .gitignore.

  • Related