回答編集履歴
1
シンタックスハイライト
    
        answer	
    CHANGED
    
    | @@ -1,13 +1,13 @@ | |
| 1 1 | 
             
            git clone で --sinble-branch を指定すれば、特定のブランチだけをリモート追跡ブランチにできます。
         | 
| 2 2 |  | 
| 3 | 
            -
            ```
         | 
| 3 | 
            +
            ```lang-bash
         | 
| 4 4 | 
             
            git clone --single-branch -b master git@git.example.com:testing.git
         | 
| 5 5 | 
             
            ```
         | 
| 6 6 |  | 
| 7 7 | 
             
            既にクローン済であれば、次のように config の `remote.origin.fetch` で変更できます。
         | 
| 8 8 | 
             
            この例では、一旦 `remote.origin.fetch` を削除して master と other ブランチを追跡するように設定しています。
         | 
| 9 9 |  | 
| 10 | 
            -
            ```
         | 
| 10 | 
            +
            ```lang-bash
         | 
| 11 11 | 
             
            git config --unset-all remote.origin.fetch
         | 
| 12 12 | 
             
            git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master
         | 
| 13 13 | 
             
            git config --add remote.origin.fetch +refs/heads/other:refs/remotes/origin/other
         | 
