Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Global gitignore of files with tilde "~" (at the end of file name)

Tags:

git

linux

My operating system is: Linux Fedora 19

On Linux when I edit a file, some text editors create a backup of that file. And git sees that backup file as a new file: my_file.txt~

How can I make a global gitignore of files with tilde ~ (at the end of file name) without creating the .gitignore file?

like image 339
Michael Avatar asked Dec 29 '25 01:12

Michael


1 Answers

You can configure a global gitignore file which will affect all of your local repos:

git config --global core.excludesfile ~/.gitignore_global

Then treat it just as the usual per repo .gitignore file.

See https://help.github.com/articles/ignoring-files for more options.

like image 130
goji Avatar answered Dec 30 '25 23:12

goji



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!