Skip to content

Commit ec966e4

Browse files
committed
add my gitconfig
1 parent acb220a commit ec966e4

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

docs/posts/2019/2019-06-19-git-cheat-sheet.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,3 +382,41 @@ echo $all_folders | tr ' ' '\n' | while read -r folder ; \
382382
## bash-git-prompt tweaks
383383
384384
[Some tweaks](../2024/2024-01-05-bash-git-prompt-tweaks.md) I made to [bash-git-prompt](https://github.com/magicmonty/bash-git-prompt). dynamic Python venv path, new var `GIT_MESSAGE`, etc.
385+
386+
## My gitconfig
387+
388+
```bash
389+
git config --global alias.amend "commit --amend -C HEAD"
390+
git config --global alias.st "status"
391+
git config --global alias.co "checkout"
392+
git config --global alias.ci "commit"
393+
git config --global alias.unstage "reset HEAD"
394+
git config --global alias.lga "log --graph --decorate --oneline --all"
395+
git config --global alias.ll "log --graph --all --pretty=format:'%C(auto)%h%Creset %an: %s - %Creset %C(auto)%d%Creset %C(bold black)(%cr)%Creset %C(bold black)(%ci)%Creset'"
396+
git config --global alias.sh "show"
397+
git config --global alias.df "diff"
398+
git config --global alias.br "branch"
399+
git config --global alias.cm "checkout main"
400+
git config --global alias.cd "checkout dev"
401+
git config --global alias.rum "pull --rebase upstream main"
402+
git config --global alias.rud "pull --rebase upstream dev"
403+
git config --global alias.rom "pull --rebase origin main"
404+
git config --global alias.rod "pull --rebase origin dev"
405+
406+
# git doesn't have a default user level gitignore file
407+
git config --global core.excludesfile ~/.gitignore
408+
409+
git config --global tag.sort "-v:refname"
410+
git config --global init.defaultbranch main
411+
412+
git config --global user.name "Xiang ZHU"
413+
git config --global user.email [email protected]
414+
415+
# for Git 2.34 or later, GPG sign commits with SSH key,
416+
# use `git log --show-signature` to view signature status
417+
git config --global gpg.format ssh
418+
git config --global user.signingkey ~/.ssh/id_ed25519.pub
419+
420+
# auto add `-S` when commit
421+
git config --global commit.gpgsign true
422+
```

0 commit comments

Comments
 (0)