Git Cheatsheet
Brief
This blog aims to memo some useful but not daily used commands.
Reference
Commands
1. Untract staged files
git rm -r --cached .
git add .
...
2. Rename a file
git mv file_from file_to
this command is basically equivalent to :
mv file_from file_to
git mv file_from
git add file_to
3. Add tag
- add tag to current commit
git tag -a tag_name -m tag_message
- add tag to history commit
git tag -a tag_name -m tag_message commit_hash
- push tag to remote
git push remote_name tag_name