My GitHub Desktop app is trying to commit a bunch of files that are (supposedly) ignored.
As you can see, the entire .metadata
folder is listed in my top-level .gitignore file. Still, there are loads of files from that folder that are being committed each time. Am I missing something about where the file needs to be placed?
EDIT: I should add, please do not just tell me to use the command line.
If you don't want Git to track certain files in your repository, there is no Git command you can use. (Although you can stop tracking a file with the git rm command, such as git rm --cached .) Instead, you need to use a . gitignore file, a text file that tells Git which files not to track.
Silently overwrite ignored files when switching branches. This is the default behavior. Use --no-overwrite-ignore to abort the operation when the new branch contains ignored files. Using --recurse-submodules will update the content of all active submodules according to the commit recorded in the superproject.
Some times, even if you haven't added some files to the repository, git seems to monitor them even after you add them to the . gitignore file. This is a caching issue that can occur and to fix it, you need to clear your cache.
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 , .pyc , and .class files.
Most often the case is that if the files existed before they were added to the .gitignore file, they will not be ignored in any following commits or pushes.
My suggestions for you, since you don't want to use the command line, is cut the files/directories from your git directory, perform a commit, and then push. After the push finished, you can paste the offending files/directories back into the git repo and they should now be ignored.
Just in case you wanted to know, you can use the git bash git rm -r --cached some-directory
and then perform a commit and push and you will have achieved the same result.
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