- Create the file and tell Git to use it
git config --global core.excludesfile ~/.gitignore_global printf '.DS_Store\n.env\n.env.local\n.vscode/\n.idea/\nnode_modules/\n' >> ~/.gitignore_global
Check it worked
- Check Git is using it
git config --global core.excludesfile && cat ~/.gitignore_global
Undo it
- Remove it
git config --global --unset core.excludesfile && rm ~/.gitignore_global
- Create the file and tell Git to use it
git config --global core.excludesfile ~/.gitignore_global printf '.env\n.env.local\n.vscode/\n.idea/\nnode_modules/\n' >> ~/.gitignore_global
Check it worked
- Check Git is using it
git config --global core.excludesfile && cat ~/.gitignore_global
Undo it
- Remove it
git config --global --unset core.excludesfile && rm ~/.gitignore_global
- Create the file and tell Git to use it
git config --global core.excludesfile "$env:USERPROFILE\.gitignore_global" Add-Content "$env:USERPROFILE\.gitignore_global" "Thumbs.db", "desktop.ini", ".env", ".env.local", ".vscode/", ".idea/", "node_modules/"
Check it worked
- Check Git is using it
git config --global core.excludesfile; Get-Content "$env:USERPROFILE\.gitignore_global"
Undo it
- Remove it
git config --global --unset core.excludesfile; Remove-Item "$env:USERPROFILE\.gitignore_global"