Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ignore file/folder in SmartGit

Tags:

git

smartgit

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.

like image 931
user3418135 Avatar asked May 16 '15 02:05

user3418135


People also ask

How do I ignore files in a folder in Git?

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.

How do I ignore files in my repository?

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.

How do I ignore a folder in Git Visual Studio?

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.


2 Answers

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.

like image 89
VonC Avatar answered Sep 19 '22 18:09

VonC


Open: Local => "Edit Ignore File..." => "Exclude File" => Edit Add directory name at new line. For example ".metadata" => Save Done :)

like image 23
Erkki Laaneoks Avatar answered Sep 20 '22 18:09

Erkki Laaneoks