Home Git Cheat Sheet
Post
Cancel

Git Cheat Sheet

Update Date: 2023-12-03

Refresh .gitignore

1
2
3
4
vim .gitignore
git rm -r --cached .
git add .
git commit -m "comments"

If there is some files you commited and not push yet, and you want to add this type of files to .gitignore.\

Ref: https://sigalambigha.home.blog/2020/03/11/how-to-refresh-gitignore/

Git Stack

1
2
3
4
5
git stash       # store current 
git stash list  # browse git stash list
git stash pop   # recover stash
git stash drop  # clean newest stash
git stash clear # clean all stashes

If you want to store some files that modified but do not want to commit and change to other branches.\

Ref: https://gitbook.tw/chapters/faq/stash

This post is licensed under CC BY 4.0 by the author.