Skip to content

Instantly share code, notes, and snippets.

@RyujiAMANO
Last active March 5, 2025 23:09
Show Gist options
  • Save RyujiAMANO/204f8c828906e90d3c86fa02fa4c8973 to your computer and use it in GitHub Desktop.
Save RyujiAMANO/204f8c828906e90d3c86fa02fa4c8973 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Alias
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 pushで同名ブランチにPUSH
git config --global push.default current
# Gitのエイリアスを設定
echo "✅ Gitエイリアスを設定"
git config --global alias.unstage "reset HEAD"
echo "🔹 unstage → ステージングをすべて取り消す"
git config --global alias.uncommit "reset --soft HEAD~1"
echo "🔹 uncommit → 直前のコミットを取り消す"
git config --global alias.updated "!git diff --name-only --diff-filter=M"
echo "🔹 updated → 変更されたファイルをリストアップ(ディレクトリ除外)"
git config --global alias.added "!git ls-files --others --exclude-standard"
echo "🔹 added → 追加されたファイル・フォルダをリストアップ(.gitignore 無視)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment