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!


Also published on Medium.

Leave a Reply

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