Git Argument
-C
run in specific directorygit -C ~/.SpaceVim pull
-filter
- The form —filter=blob:none omits all blobs.
push
diff
-
Compare with previous commit: use
^!
git diff 77e13ax^!
-
Compare specific directory
git diff hash1 hash2 - path/to
-
See the number of changes
git diff —stat hash1 hash2
-
See what in staged area
git diff —staged
-
hash-object
converts an existing file into a git object -
cat-file
prints an existing git object to the standard output.
config
To get all config value, use --list
-
git config --list
or look at your~/.gitconfig
file. The local configuration will be in your repository’s.git/config
file. -
git config --list --show-origin
-
Generating a new SSH key and adding it to the ssh-agent - GitHub Docs
To get a particular config value, use --get
git config --get --global color.ui
Creating a personal access token - GitHub Docs
-
git config --global credential.helper store
-
git config --global init.defaultBranch main
reset
- version control - What’s the difference between git reset —mixed, —soft, and —hard? - Stack Overflow