LoginSignup
1
1

派生元ブランチとの差分のPHPファイル一覧を取得する

Last updated at Posted at 2024-04-05

必要に迫られてエイリアスを作りました。

~/.zshrc に追記する。

~/.zshrc
alias derived-branch='git show-branch | grep '\''*'\'' | grep -v "$(git rev-parse --abbrev-ref HEAD)" | head -1 | awk -F'\''[]~^[]'\'' '\''{print $2}'\'''
alias derived-diff="git --no-pager diff --name-only \$(derived-branch)"
alias derived-php-diff="git --no-pager diff --name-only \$(derived-branch) -- '*.php'"

派生元ブランチを取得します。
ローカルにないとブランクになります。

$ derived-branch

派生元ブランチと差分のファイル一覧をすべて表示します。

$ derived-diff

派生元ブランチと差分のPHPファイル一覧を表示します。

$ derived-php-diff

Gitシリーズ記事まとめ

参考

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1