How to make a file. gitignore global

Asked

Viewed 606 times

1

I may have a file .gitignore global? IE, that independent of the project it eliminates for example the files of the operating system?

1 answer

1


Yes you can create global delete rules for your user on your local machine. These rules will be valid for all repositories only on your local machine, the Global exclusion rules will not reflect on the other copies of the repository that are on other machines.

For example, you can create the file .gitignore_global and add some rules to it.

To do this open the terminal and enter the command:

  • In the Mac and Linux: git config --global core.excludesfile ~/.gitignore_global

  • In the Windows: git config --global core.excludesfile "%USERPROFILE%\.gitignore_global"

After that open your favorite text editor and put your delete rules as a file .gitignore recommend to use the file generator rules .gitignore gitignore.:

Source: https://help.github.com/articles/ignoring-files/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.