サブコマンド | シンタックス | 説明 |
---|---|---|
init | $ git init |
リポジトリの作成 |
add | $ git [file name] |
ファイルやディレクトリをインデックスに追加 |
commit | $ git commit |
インデックスに追加されたファイルをコミット |
status | $ git status |
前回のコミットとの比較 |
log | $ git log |
コミットログの表示 |
diff | $ git diff |
インデックスとワーキングツリーの差分を表示 |
checkout | $ git checkout [commit id] [filename] |
[commit id]の[filename]を復元 |
show | $ git show |
最新のコミット内容を表示 |
reset | $ git reset [commit id] |
インデックスを[commit id]の状態にする |
rm | $ git rm [filename] |
インデックスとワーキングツリーからファイルを削除 |
mv | $ git [filename 1] [filename 2] |
ファイル名を変更 |
revert | $ git revert [commit id] |
[commit id]のコミットを取り消す |
rebase | $ git rebase -i [commit id] |
[commit id]から古い順にコミットを一覧表示&編集 |
clone | $ git clone [repository PATH] [new repository PATH] |
リポジトリをコピー |
push | $ git push [remote repository PATH] [branch] |
リモートリポジトリに変更を反映 |
pull | $ git pull [remote repository PATH] [branch] |
リモートリポジトリの変更を取り込む |
remote | $ git remote |
リモートリポジトリの一覧を表示 |
fetch | $ git fetch [remote repository] |
リモートリポジトリの最新情報を追加 |
branch | $ git branch [new branch name] |
新しいブランチの作成 |
merge | $ git merge [branch] |
現在のブランチと他のブランチをマージ |
tag | $ git tag |
タグの一覧表示 |
stash | $ git stash |
現在の状態を保存する |
reflog | $ git reflog |
過去にHEADが指していたコミット一覧を表示 |
config | $ git config -l |
使用されているリポジトリの設定を表示 |
Last active
January 12, 2017 08:41
-
-
Save mojagehub/aed963805b79c773c9343a3c735d01aa to your computer and use it in GitHub Desktop.
gitCommandNotes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment