How do i create a global exclude file in git?



  • In git it is possible to exclude certain files on the entire computer, rather than just for the certain repository. Put the file in your home directory, the key thing is to use the global option to git config.

    This is useful as it will never push the entries specified in the file, normall *.swp, vim editor file, *.retry files ansible creates, various other temp files, etc.

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

    You can also explicitly exclude using an editor to edit .git/info/exclude in your local repository, add entries you want to exclude


Log in to reply
 

© Lightnetics 2024