How to create a branch in git basing it on a remote branch -


this question has answer here:

the remote repo has branch doesn't exist on local repo. need fetch , start working without merging other branches have. how can it?

you can type:

git fetch <remote> 

to fetch refs remote,

git checkout <remote>/<branch> 

lets checkout remotes branch "anonymous" branch,

git checkout -b <new_local_branch> 

creates local branch based on remote 1 checked out.

you can set remote branch upstream:

git branch --set-upstream-to=<remote/branch> <new_local_branch> 

Comments