Git Argument
-Crun 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-objectconverts an existing file into a git object -
cat-fileprints an existing git object to the standard output.
config
To get all config value, use --list
-
git config --list
or look at your~/.gitconfigfile. The local configuration will be in your repository’s.git/configfile. -
git config --list --show-origin -
Generating a new SSH key and adding it to the ssh-agent - GitHub Docs
git config --global gpg.format ssh
pbcopy < ~/.ssh/id_ed25519.pub
git config --global user.signingkey 'key'
git config --global commit.gpgsign true
git config --global tag.gpgsign true
git config --global color.ui autoTo 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
submodule
git submodule update --init --recursive