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

【差分メモ抽出】

git diff --name-status main..dev

意味:mainとdevの差分ファイルがそれぞれ更新・追加・削除のどういう状況かまでを示す

例えばindex.htmlの更新をした場合

M       index.html

【HEADポインタがどこのcommit IDを指しているか】

git log --oneline --decorate -1

【non fast forward merge】

git merge --no-ff <branch-name>

【stash】

(untracked files含む)
git stash -u

(履歴をコメント付きで記録)
git stash -u -m "hogehoge作業の途中"

【stash履歴の確認】

git stash list

【stashした記録を復元】

git stash apply stash@{0}
※0が最新。複数stash履歴がある場合、任意の番号を指定する
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?