Add something to .gitignore

Refreshes the tracking of your files. Super useful for adding new things to your .gitignore file.

# you can either removed all the cached files
git rm -r --cached .

# or you can removed the file/folder individually
git rm -r --cached generated-styles.css
Updated: 19 January 2022

Git stash

An underrated command in my opinion. Need to quickly switch branch but don't want to commit your changes on the current branch just yet? Git stash is perfect for this.

# for when it's too hard to think of a message
git stash

# to make it clearer what each stash is
git stash save "optional message for yourself"

# apply the latest stash (I tend to use this the most)
git stash apply stash@{0}

# view a list of your stashes
git stash list
Updated: 19 January 2022