March 13, 2025 (updated March 31, 2025)
This is just a simple reference note for Git commands I use often but tend to forget. It’s meant to be an evergreen document and will be updated as necessary.
Create a new branch
git branch <BRANCH_NAME>
Switch to a branch
git checkout <BRANCH_NAME>
or
git switch <BRANCH_NAME>
Creat a new branch and switch to it in one go
git checkout -b <BRANCH_NAME>
List remote repositories
git remote -v
Change remote repository URL
git remote set-url origin <NEW_URL>
List current configurations
git config -l
Omit files from being checked for changes
git update-index --assume-unchanged <PATH_TO_FILE>
Undo the above
git update-index --no-assume-unchanged <PATH_TO_FILE>
List files marked with --assume-unchanged
git ls-files -v