Git コマンド
If you've just started using Git, you may need to refer to this page a few times before you get the hang of using them from the command line.
タスク | Git コマンド |
---|---|
新しいローカル ディレクトリを作成する | git init |
ローカル リポジトリをリモート サーバーに接続する | git remote add origin <server_URL> |
リモート リポジトリをローカル システムにコピーする | git clone <リポジトリの URL> |
特定のファイルをステージングに追加する (Git) または新しいファイルが作成された後に追加する (Hg): | git add <filename> |
すべての変更をステージングに追加する (Git) またはすべての新規ファイルに追加する(Hg): | git add --all |
変更をローカル側でコミットする: | git commit -m '<message>' |
変更をリモート リポジトリへプッシュする: |
通常: |
変更したファイルや、追加またはコミットの必要があるファイルのステータスを一覧表示する: | git status |
新しいブランチを作成 (Git) またはブックマークを作成 (Hg) してそれに切り替える: | git checkout -b <branch_name> |
1 つのブランチまたはブックマークから別のブランチまたはブックマークに切り替える: | git checkout <branch_name> |
自分のリポジトリ内のブランチ/ブックマークをすべて一覧表示し、現在自分がいるブランチ/ブックマークを示す: | git branch |
機能ブランチ/ブックマークを削除する | git branch -d <ブランチ名> |
ブランチ/ブックマークをリモート リポジトリへプッシュする | git push origin <ブランチ名> |
リモート サーバーで変更を取得し、作業ディレクトリにマージする | git pull |
2 つの異なるバージョンを 1 つにマージする | git merge |
最後のコミット以降に行われたすべての変更を表示する | git diff |
For more commands, check out Bitbucket Server's Basic Git commands.
最終更新日 2020 年 9 月 18 日
Powered by Confluence and Scroll Viewport.