set-branches
Changes the list of branches tracked by the named remote. This can be used to track a subset of the available remote branches
after the initial setup for a remote.
The named branches will be interpreted as if specified with the -t option on the git remote add command line.
With --add, instead of replacing the list of currently tracked branches, adds to that list.
name:directory zgong$ git fetch release-20.10.04 release-20.10.04
fatal: 'release-20.10.04' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
WM-C02WM0T3HTD8:vdca_android_20_10_04_stable zgong$ git fetch origin release-20.10.04
From ssh://stash.trusted.visa.com:7999/vdcbc3a/vmcp-android-mobile-app
* branch release-20.10.04 -> FETCH_HEAD
WM-C02WM0T3HTD8:vdca_android_20_10_04_stable zgong$ git checkout -b release-20.10.08 origin/release-20.10.08
fatal: 'origin/release-20.10.08' is not a commit and a branch 'release-20.10.08' cannot be created from it
WM-C02WM0T3HTD8:vdca_android_20_10_04_stable zgong$ git fetch origin release-20.10.08
remote: Counting objects: 637, done.
remote: Compressing objects: 100% (320/320), done.
remote: Total 637 (delta 303), reused 465 (delta 202)
Receiving objects: 100% (637/637), 312.26 KiB | 262.00 KiB/s, done.
Resolving deltas: 100% (303/303), done.
From ssh://stash.trusted.visa.com:7999/vdcbc3a/vmcp-android-mobile-app
* branch release-20.10.08 -> FETCH_HEAD
* [new branch] release-20.10.08 -> origin/release-20.10.08
WM-C02WM0T3HTD8:vdca_android_20_10_04_stable zgong$ git checkout -b release-20.10.08 origin/release-20.10.08
M VMCP/fmcore_android
M VMCP/foundation_android
M VMCP/mep_3ds_android
M VMCP/mep_login_android
M VMCP/mep_provisioning_and
Branch 'release-20.10.08' set up to track remote branch 'release-20.10.08' from 'origin'.
Switched to a new branch 'release-20.10.08'
# with --add it will add the branch instead of setting it
# you can add multiple branches with multiple --add lines
# wildcards are allowed,
# e.g. branch_v\* matching branch_v1, branch_v2, ...
git remote set-branches [--add] <remote_repo> <remote_branch>
# If you set only one <remote_branch> in the restrictions above (i.e no option 4),
# then you can omit it and still only <remote_branch> will be fetched
git fetch <remote_repo> [<remote_branch>]
# without -b the local branch name is guessed to be the same as the remote one
git checkout --track [-b <local_branch>] <remote_repo>/<remote_branch>
检查一个远程对象和已经获取或将要获取的分支的最佳命令是git remote show <remote_repo>。它打印“远程分支”下的分支列表:它还告诉你它们是否被获取,是否被跟踪。