1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

gitコマンドまとめ(よく使うやつ)

Last updated at Posted at 2020-09-29

#よく使うコマンドをまとめる

$ git checkout -b <ブランチ名> origin/<ブランチ名>

ローカルに持ってきてブランチ切り替え

$ git reset HEAD --hard

現在のディレクトリの全てのファイルをリセット(HEADは直前)

$ git branch -D <ブランチ名>

ブランチを削除 detached HEADの時に使える

$ git log --oneline

1行でlogを見る

$ git checkout -- <file_name>

Fime_nameの変更点を消せる

$ git commit --amend

前回のコミットに変更点を載せるイメージ

$ git checkout -b <ブランチ名>

ローカルにブランチを作る

$ git push origin HEAD

current branch に push (5/3 追記)

$ git checkout -b remotes/origin.... orgin/....

リモートリポジトリにローカルリポジトリに

1
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?