development:git
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン次のリビジョン両方とも次のリビジョン | ||
development:git [2019/01/23 05:27] – hayashi | development:git [2020/07/27 15:27] – [ユーザ名・パスワードの設定] hayashi | ||
---|---|---|---|
行 1: | 行 1: | ||
====== git ====== | ====== git ====== | ||
+ | |||
+ | ===== branchコマンド ===== | ||
+ | ==== git branch ==== | ||
+ | ローカルブランチの一覧を表示 | ||
+ | ==== git branch -r ==== | ||
+ | |||
+ | |||
+ | -r、もしくは、--remotes\\ | ||
+ | リモートブランチの一覧を表示 | ||
+ | ==== git branch -a ==== | ||
+ | -a、もしくは--all\\ | ||
+ | リモートブランチを含んだブランチの一覧を表示 | ||
+ | |||
+ | ==== git branch --merged ==== | ||
+ | |||
+ | |||
+ | HEADにマージ済みのブランチの一覧を表示 | ||
+ | |||
+ | ==== git branch --no-merged ==== | ||
+ | |||
+ | |||
+ | HEADにマージされていないブランチの一覧 | ||
+ | |||
+ | ==== git branch < | ||
+ | |||
+ | 指定したbranchnameで、新しいブランチを作成\\ | ||
+ | 新しく作成したブランチへの切り替えを行う場合は、git checkout < | ||
+ | 新しいブランチの作成と切り替えを同時に行う場合は、git checkout -b < | ||
+ | |||
+ | ==== git branch -d < | ||
+ | |||
+ | -d、もしくは、--delete\\ | ||
+ | 指定したブランチを削除\\ | ||
+ | -rを付けた場合は、リモートブランチを削除\\ | ||
+ | 指定したブランチの内容が、追跡しているリモートブランチ(設定されていない場合はHEAD)にマージされていないと削除できない | ||
+ | |||
+ | ==== git branch -D < | ||
+ | |||
+ | |||
+ | マージの状態に関わらず、指定したブランチを削除 | ||
+ | |||
+ | ==== git branch -m <new branchname> | ||
+ | |||
+ | -m、もしくは、--move\\ | ||
+ | |||
+ | 現在チェックアウトしているブランチ名を< | ||
+ | git branch -m <old branchname> | ||
===== 標準出力に出力 ===== | ===== 標準出力に出力 ===== | ||
行 31: | 行 78: | ||
===== shortlog ===== | ===== shortlog ===== | ||
- | shortlog コマンドは git log の特別なバージョンで、リリースのお知らせを作成することを目的としています。作成者別に各コミットを分類し、各コミットメッセージの最初の行を表示します。これは、誰がどんな作業をしているかについて確認する簡単な方法です。 | + | shortlog コマンドは git log の特別なバージョンで、リリースを作成することを目的としています。\\ |
+ | 作成者別にコミットメッセージの最初の行を表示します。 | ||
===== 特定のフォルダのみpull ===== | ===== 特定のフォルダのみpull ===== | ||
行 46: | 行 94: | ||
# git remote set-url --push origin User@newrepos.example.net:/ | # git remote set-url --push origin User@newrepos.example.net:/ | ||
# git push --mirror | # git push --mirror | ||
+ | |||
+ | ===== ユーザ名・パスワードの設定 ===== | ||
+ | |||
+ | <file config ~/ | ||
+ | machine github.com | ||
+ | login username | ||
+ | password xxxxxxx | ||
+ | </ | ||
+ | |||
+ | または、git cloneするURLに埋め込む((user, | ||
+ | |||
+ | git clone https:// | ||
+ | |||
===== 参考 ===== | ===== 参考 ===== | ||
- | [[https:// | + | * [[https:// |
+ | * [[https:// |
development/git.txt · 最終更新: 2022/08/14 13:23 by hayashi