gitignore

Creating a .gitignore file in the root folder of your project will ensure every file that matches a line within the file will be ignored by git. It uses globs.

Global gitignore

You can ignore files globally by adding them to ~/.gitignore_global. You can also use a git template[3] and add an exclude file.

Delete previous files in gitignore

If you add a file to .gitignore after previously committing that file, you may see untracked changes on those files. You have to remove the old files from the git repository to remove that error.

References

  1. https://stackoverflow.com/questions/107701/how-can-i-remove-ds-store-files-from-a-git-repository
  2. https://git-scm.com/docs/gitignore
  3. https://www.darrik.dev/writing/custom-git-template/

Last modified: 202401290248