Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I ignore PyCharm configuration files in a git repository?

I don't want to commit my PyCharm config files (e.g. .idea/codeStyleSettings.xml) to my git repository, so I added the following to my .gitignore file:

.idea/ mydjangosite/.idea/ 

However, every time I try to make a commit within PyCharm (command k), it still wants to commit these files. How do I get PyCharm to recognize my .gitignore file and not commit these files?

like image 561
Jamie Forrest Avatar asked Feb 11 '12 02:02

Jamie Forrest


People also ask

How do I set Git to ignore files?

If you want to ignore a file that you've committed in the past, you'll need to delete the file from your repository and then add a . gitignore rule for it. Using the --cached option with git rm means that the file will be deleted from your repository, but will remain in your working directory as an ignored file.

How do I configure Git to ignore all TXT files?

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 repository?

If you want to maintain a folder and not the files inside it, just put a ". gitignore" file in the folder with "*" as the content. This file will make Git ignore all content from the repository.

Where do I put Gitignore file in PyCharm?

gitignore file in the VCS root directory, you can right-click anywhere in the Project window, choose New | File and type . gitignore in the New File dialog.


1 Answers

If PyCharm offers you to commit the files, it means that you have already added them to Git. You need to remove them using 'git rm --cached' and commit the change. After that, they will be ignored by the integration according to your .gitignore settings.

like image 139
yole Avatar answered Oct 09 '22 23:10

yole