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でプッシュできないときに確認すること

0
Last updated at Posted at 2026-05-07

久しぶりにプッシュしようとするとうまくいかないことがあります。
そんな時に使うコマンドをまとめました。

↓そもそもちゃんとaddできているのかを確認

git status

↓自分がいるのは、想定しているブランチなのか確認

git branch

違ったら、↓で移動したいブランチに行きましょう。

git switch ブランチ名

ブランチ名指定するのだるいという時には、HEADで指定すると、名前を指定しなくても、今のブランチからプッシュしてくれます。↓

git push origin HEAD

それでも、できなかったら、ログを見ましょう。

git log --oneline --graph --all

↓解説
--oneline: 1つのコミットを1行に凝縮

--graph: 枝分かれを線で表示

--all: 全てのブランチを表示

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?