0
0

Git – 現在ブランチの状態をリモートの状態に強制リセットする .gitconfigのエイリアス設定

Posted at

コマンドで言うと

git fetch
git reset --hard origin/<現在チェックアウトしているブランチ>

っていうことをやりたい

.gitconfig

.gitconfigでエイリアス設定する

[alias]
  current = !git symbolic-ref --short HEAD
  reset-current = !git fetch && git reset --hard origin/$(git current)

実行

git reset-current

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

0
0
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
0
0