Skip to content

Instantly share code, notes, and snippets.

@RyujiAMANO
Created September 12, 2025 05:50
Show Gist options
  • Select an option

  • Save RyujiAMANO/351f680d741c8ef59e5f2d5250ad6fec to your computer and use it in GitHub Desktop.

Select an option

Save RyujiAMANO/351f680d741c8ef59e5f2d5250ad6fec to your computer and use it in GitHub Desktop.
setup-my-git.sh
#!/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"
# ---- 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
@RyujiAMANO
Copy link
Author

RyujiAMANO commented Sep 12, 2025

curl -sL https://gist.githubusercontent.com/RyujiAMANO/351f680d741c8ef59e5f2d5250ad6fec/raw/66c64b54f3feab8ead003452c3d5a2448b5bf6e8/setup-my-git.sh |bash
source ~/.bashrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment