Git Rebase by Default

When working on a project with multiple developers it’s a good idea to always rebase when you pull.

git pull --rebase

But if you would like to rebase by default, you can add it to your global .gitconfig file by running this command:

git config --global pull.rebase true

Hope this saves you some time!

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!