Ignoring directories in Git repos on Windows
Windows explorer will show .gitignore when in-fact the file name is .gitignore.txt
.gitignore.txt is not use in git
User may not able to rename the file to .gitignore because explorer thinks its a file of type gitignore with no name.
Non command line solution:
You can rename a file to ".gitignore." and it will create ".gitignore"
Ignoring files and directories there are two main ways are given below:
- Allocate .gitignore file into the root of your repo besides .git folder in Windows make sure you see the real file extent and then make .gitignore. with the point at the end to make empty file extension
- Preparing global configuration ~/.gitignore_global and operating git config –global core.excludesfile ~/.gitignore_global to add this to your git config
files tracked before can be untracked by operating git rm –cached filename
2. Repo exclude – For local files no need to be shared, just add the file pattern or directory to the file .git/info/exclude. These rules are not commited, are not seen by other users