1
1

git push --force したくなった時の事故防止オプション

Last updated at Posted at 2024-08-27
# NG
git push --force

# OK
git push --force-with-lease --force-if-includes
  • --force 制限なしにpush
  • --force-with-lease fetchしてないとコケる
  • --force-if-includes fetchしてもコミットが取り込まれてないとコケる

オプションが長いのでエイリアスを登録する

git config --global alias.pushf 'push --force-with-lease --force-if-includes'
git pushf

参考

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