I'm using SmartGit. I want to ignore a folder in repository. When I right-click folder, option "Ignore" is grayed out and I can't click it.
gitignore file is a plain text file that contains a list of all the specified files and folders from the project that Git should ignore and not track. Inside . gitignore , you can tell Git to ignore only a single file or a single folder by mentioning the name or pattern of that specific file or folder.
You can create a . gitignore file in your repository's root directory to tell Git which files and directories to ignore when you make a commit. To share the ignore rules with other users who clone the repository, commit the . gitignore file in to your repository.
Open Visual Studio and the solution needing an ignore file. From the top menu select Git > Settings. The above will open Visual Studio's Options with Source Control > Git Global Settings selected. From the list on the left select Git Repository Settings and then click the Add button for Ignore file.
You would need to make sure this folder content isn't versioned first.
In command line, try a git rm --cached -r yourFolder/
Then check if the ignore option is now available.
The other reason would be because that folder is empty. since Git doesn't track empty folder, maybe SmartGit doesn't allow to ignore it.
Open: Local => "Edit Ignore File..." => "Exclude File" => Edit Add directory name at new line. For example ".metadata" => Save Done :)
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