git fetch
リモートリポジトリの内容を追跡ブランチに持ってくるコマンド。
用例
- リモートリポジトリの内容をローカルリポジトリに反映
git fetch
- リモートリポジトリにあるすべてのブランチの最新情報を、追跡ブランチに取得
git fetch origin
- リモートリポジトリにある「hoge」ブランチの最新情報を、追跡ブランチに取得
git fetch origin hoge
- リモートリポジトリのすべての最新をフェッチ
git fetch --all
書式
git fetch [options]
公式によると以下の通り。
git fetch [<options>] [<repository> [<refspec>…]] git fetch [<options>] <group> git fetch --multiple [<options>] [(<repository> | <group>)…] git fetch --all [<options>]
options
/x | xxx |
etc.
説明
リモートリポジトリの内容を追跡ブランチに持ってくるコマンド。
- フェッチはローカルリポジトリに持ってくるだけで、ワークツリー(作業フォルダ)の内容には影響を与えない。
- ワークツリーにも反映させたい場合はフェッチを行わずにプルするか、フェッチを行った後にマージを行う必要がある。
関連
参考リンク
- git fetch - Gitコマンド虎の巻
- Git - git-fetch Documentation
- xxxxxxxx?
- xxxxxxxx?
- xxxxxxxx?
- xxxxxxxx?
- xxxxxxxx?
- xxxxxxxx?
その他メモ
なにかあれば。