| 初期設定を行う | git config –global user.name “XXXX” |
| | git config –global user.email “XXXX@hogehoge.com” |
| ローカルにリポジトリを作成し、リモートにプッシュする | git init |
| | git add . |
| | git commit -m “Initial commit” |
| | git remote add origin https://github.com/XXXX/XXXXXX.git |
| | git push -u origin master |
| リモートからクローンする | git clone https://github.com/XXXX/XXXXXX.git |
| リモートから変更を取得する | git pull |
| ファイルの登録(コミットするため) | git add <ファイル名> |
| ファイルの変更や追加をコミット | git commit -m “コミットメッセージ” |
| ローカルの変更を確認する | git status |
| リモートとローカルのファイルの差分を抽出する | git diff <ファイル名> |
| commitの変更履歴をみる | git log |
| 指定したcommitの変更点を見る | git show <コミットのハッシュ値> |
| リモートにプッシュ | git push origin <ブランチ名> |
| addの取り消し | git reset HEAD <ファイル名> |
| commitの打ち消し | git revert <コミットのハッシュ値> |
コメント