Last active
February 26, 2026 17:08
-
-
Save RyujiAMANO/351f680d741c8ef59e5f2d5250ad6fec to your computer and use it in GitHub Desktop.
setup-my-git.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # ---- Git aliases ---- | |
| git config --global alias.s status | |
| git config --global alias.b branch | |
| git config --global alias.co checkout | |
| git config --global alias.ci commit | |
| git config --global push.default current | |
| git config --global alias.unstage "reset HEAD" | |
| git config --global alias.uncommit "reset --soft HEAD~1" | |
| git config --global alias.updated "!git diff --name-only --diff-filter=M" | |
| git config --global alias.added "!git ls-files --others --exclude-standard" | |
| git config --global alias.sq 'merge --no-commit --squash' | |
| # global ignore taktがXDG_CONFIG_HOMEを上書きするため、takt上だと ~/.config/git/ignoreが読まれなくなるので明示 | |
| git config --global core.excludesfile ~/.config/git/ignore | |
| # ---- Shell alias ---- | |
| echo "alias g='git'" >> ~/.bash_aliases_custom | |
| grep -qxF '[ -f ~/.bash_aliases_custom ] && . ~/.bash_aliases_custom' ~/.bashrc \ | |
| || echo '[ -f ~/.bash_aliases_custom ] && . ~/.bash_aliases_custom' >> ~/.bashrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.