git add . # Add everything in current dir tree. This include sub-dir recursively.git add <file/dir>...
Remove From Stage
1
git rm <file/dir>...
Commit Staged Changes
1
2
3
git commit -m '<comment>'git commit -a # Commit all staged files.git commit <file/dir> # Commit files directly even not staged.
Tag
Add
1
2
3
4
5
git tag # List tagsgit tag <version> # Light weight taggit tag -a v0.1 -m "Version 0.1"git tag -a <version> -m '<comment>'git show <version> # Show tagged commit
--hard Resets the index and working tree. Any changes to tracked files in the working tree since <commit> are discarded.
--soft Does not touch the index file or the working tree at all (but resets the head to <commit>, just like all modes do). This leaves all your changed files “Changes to be committed”, as git status would put it.
This is prefer over revert when backing out from local commit, before pushing to remote.