switch to remote branch git 1

switch to remote branch git

# First fetch all new_remote refs
git fetch new_remote
# Then
git checkout -b  --track new_remote/

Here is what the above code is Doing:
1. git fetch new_remote
This fetches all the new_remote’s branches and stores them in your local repo.
You can see them by running git branch -a.
You’ll see something like this:
* master
remotes/new_remote/master
remotes/new_remote/branch1
remotes/new_remote/branch2
remotes/new_remote/branch3
remotes/new_remote/branch4
remotes/new_remote/branch5
remotes/new_remote/branch6
remotes/new_remote/branch7
remotes/new_remote/branch8
remotes/new_remote/branch9
remotes/new_remote/branch10
remotes/new_remote/branch11
remotes/new_remote/branch12
remotes/new_remote/branch13
remotes/new_remote/branch14
remotes/new_remote/branch15
remotes/new_remote/branch16
remotes/new_remote/branch17
remotes/new_remote/branch18
remotes/new_remote/branch19
remotes/new_remote/branch20
remotes/new_remote/branch21
remotes/new_remote/branch22
remotes/new_remote/branch23
remotes/new_remote/branch24
remotes/new_remote/branch25
remotes/new_remote/branch26
remotes/new_remote/branch27
remotes/new_remote/branch28
remotes/new_remote/branch29
remotes/new_remote/branch30
remotes/new_remote/branch31
remotes/new_remote/branch32
remotes/new_remote/branch33
remotes/new_remote/branch34
remotes/new_remote/branch35
remotes/new_remote/branch36
remotes/new_remote/branch37
remotes/new_remote/branch38
remotes/new_remote/branch39
remotes/new_remote/branch40
remotes/new_remote/branch41
remotes/new_remote/branch42
remotes/new_remote/branch43
remotes/new_remote/branch44
remotes/new_remote/branch45
remotes/new_remote/branch46
remotes/new_remote/branch47
remotes/new_remote/branch48
remotes/new_remote/branch49
remotes/new_remote/branch50
remotes/new_remote/branch51
remotes/new_remote/branch52
remotes/new_remote/branch53
remotes/new_remote/branch54
remotes/new_remote/branch55
remotes/new_remote/branch56
remotes/new_remote/branch57
remotes/new_remote/branch58
remotes/new_remote/branch59
remotes/new_remote/branch60
remotes/new_remote/branch61
remotes/new

Similar Posts