0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

個人的によく使うけど毎回調べがちなGitコマンド忘備録

Last updated at Posted at 2025-02-18

この記事を書いた理由

add, commit, push, rebase, pull, merge, checkout 等、業務内でGit操作に関することでは割と不安が無くなってきて、ブランチ運用の話などを割とできるようになったかなぁと思うのですが、ちょくちょく使うコマンドを毎回覚えきれずに簡単に調べてみるのが面倒になってきたので、忘備録としてまとめてみたいと思います。
アウトプットが記憶の定着への近道!!

コマンド

カレントコミットを解除してステージング状態に戻す

git reset --soft HEAD~

カレントコミットのメッセージを変更する

git commit --amend -m "変更したいメッセージ"

カレントブランチの名称を変更する

git branch -m "新しいブランチ名"

強制push(リベース実施後など)

git push -f

最後に

他にも何かあった気がするのですが、いざこうやって記事を書いてみると思い出せないもので....
業務中にでも思い出したら書いてみます。
ありがとうございました。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?