0
1

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 3 years have passed since last update.

Gitコマンドメモ

Posted at
Git設定一覧
$ git config -l
ブランチ一覧
$ git branch
直前のコミットを取り消す
$ git reset --soft HEAD^
Windowsで使う場合は"HEAD^"
特定ファイルのみ元に戻す
$ git checkout [コミット番号] [ファイルパス]
変更したファイルの差分一覧
$ git diff --name-only <コミットID1> <コミットID2>
特定のファイルの差分
$ git diff <コミットID1> <コミットID2> <ファイル名>
リモートのdevelopブランチをローカルのmainブランチにpull
$ git pull origin develop:main
ローカルのdevelopブランチをリモートのmasterブランチにpush
$ git push origin develop:master
特定のファイルを元に戻す
$ git checkout <filename>
リモートoriginを変更
$ git remote rm origin
$ git remote add origin https://github.com/bar/hogehoge.git
config変更
$ git config --global user.name hogehoge
$ git config --global user.email example@hogehoge.com
gitignoreに反映されない場合
$ git rm -r --cached <ファイル名>
$ git ls-files --other --ignored --exclude-standard
無視しているファイルの一覧
  • origin: デフォルトのリポジトリの場所(URL)の別名
  • main: デフォルトのブランチの名前。メインのブランチ
0
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?