I use Tower for using Git in Mac. The settings in Tower has Ignores section which creates the .gitignore, but it has another section named "Excludes". And it seems like that one can use excludes with "# git ls-files --others --exclude-from=.git/info/exclude".
What Excludes is for? Why one needs excludes when gitignore is available?
git/info/exclude is the same as . gitignore, just a lower precedence and not in the repository (so, not committed and shared). Neither affects already tracked files. Both affect files that are not currently tracked.
gitignore file is a text file that tells Git which files or folders to ignore in a project. A local . gitignore file is usually placed in the root directory of a project. You can also create a global . gitignore file and any entries in that file will be ignored in all of your Git repositories.
Ignored files are usually build artifacts and machine generated files that can be derived from your repository source or should otherwise not be committed. Some common examples are: dependency caches, such as the contents of /node_modules or /packages. compiled code, such as .o , .
Set “–assume-unchanged” to a path to exclude to check on git commit and it will exclude your file from git commit. You will need to use the git update-index and –assume-unchanged to exclude files from git commit.
It's a list of files that are not in .gitignore
(which can be versioned), but which you want to exclude on your machine's copy of the repo.
From the docs:
Patterns which are specific to a particular repository but which do not need to be shared with other related repositories (e.g., auxiliary files that live inside the repository but are specific to one user's workflow) should go into the $GIT_DIR/info/exclude file.
Note that .git/info/exclude can not be versioned because it's in the .git directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With