git add
options
Description
Add changes to the staging area
Options
- .
- Add all the files with changes
- folder
- Add all the changes inside a folder. Including the folder itself.
- file
- Add all the changes in a file.
- –u
- Add all the changes of the tracked files.
git commit –m
message
Description
Wrap all current changes in staging area into a commit node with the
message passed as option.
git commit –am
message
Description
Wrap all changes of tracked files in workind directory into a commit
node with the message passed as option.
git reset HEAD
options
Description
Remove the changes from the staging area and keep those changes in
the working directory.
You can pass the same options as
git add to select which
changes you want to remove.
git reset ––soft HEAD~
Description
Undo last commit. The changes will be kept in the staging area.
git diff
Description
Show changes of tracked files in the working directory.
git diff ––cached
Description
Show detailed changes of files in the staging area.
git log
options
Description
Show log of commit nodes.
Options
- ––oneline
- Output in short format, just show abbreviated hash and title.
- –p
- Show also the diff of the changes.
- ––stat
- Show also statistics of adds and removes in each commit.
git status
options
Description
Show the name of the files with changes either in working directory or staging area.
Options
- –s
- Output in short format