How to Edit Global Git Ignore

Recently I was trying to add some folders to my global .gitignore file on windows. Unfortunately I ran into some issues. After some searching, I couldn’t come across a solution that worked for me. Here are the steps that worked for me.

Add to Global Git ignore Windows

  1. git config --global core.excludesfile ~/.gitignore_global (Add .gitignore_global as the global gitignore file in your global git config)
  2. notepad %USERPROFILE%\.gitignore_global (Create and edit .gitignore_global in your home directory using cmd)

Add to Global Git ignore Mac

  1. git config --global core.excludesfile ~/.gitignore_global (Add .gitignore_global as the global gitignore file in your global git config)
  2. sudo nano ~/.gitignore_global(can edit your .gitignore_global file and add any files or folder you would like to ignore. Use ctrl + y to save and exit)

Leave a comment if these steps helped in any way!


Thanks for reading. Make sure you follow me on Twitter to stay up to date on the progress of my side projects T.LYWeather Extension, and Link Shortener Extension. If you are interested in the tech I use daily, check out my uses page.  

6 thoughts to “How to Edit Global Git Ignore”

  1. There are double dashes for global option. Thanks!!!
    ““
    git config –global core.excludesfile ~/.gitignore_global
    ““

        1. Thanks for the correction. Funny thing is I had the double dashes but the text displayed as a single dashed. Had to tell the editor it is code so it will display correctly. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *