user image

Eslam Zedan
Published in : 2022-03-03

How to checkout to new created branch on bitbucket

General

Somebody pushed a branch called release with git push our repository.

Now I'm trying to check out to  release branch.

I've tried:

git checkout release which does nothing

git checkout origin/release gives * (no branch)

How do I check out a remote Git branch?

Comments

Shilpa Date : 2022-03-03

Best answers

10

Best answers

10

You can fix the issue by the below command.

git fetch origin 'your_remote_branch':'your_local_branch_name'

This will fetch your remote branch

It will also create a new local branch by name “your_local_branch_name” (if it is not existing)

Here you can track the remote one in it.

– – – – 

To checkout local code, you can use below commands,

git fetch
git checkout -b your_local_branch_name origin/actual_branch_name

It will work for you.

Leave a comment

Join us

Join our community and get the chance to solve your code issues & share your opinion with us

Sign up Now

Related posts

what is alternative for sending mail through Gmail SMTP?
Publish date: 2022-06-08 | Comments: 1

Tag: General

Password authentication is temporarily disabled as part of a brownout.
Publish date: 2021-07-28 | Comments: 2

Tag: General

Unable to Connect AWS EC2 Instance with my subdirectory through domain registrar.
Publish date: 2022-02-25 | Comments: 2

Tag: General

Chrome shows cursor everywhere where I click?
Publish date: 2022-03-11 | Comments: 2

Tag: General

Is there any port I need to allow in google VM instances to allow SMTP?
Publish date: 2022-02-14 | Comments: 1

Tag: General

[solved] Unable to pull updates from git "sudo git pull"
Publish date: 2021-12-20 | Comments: 1

Tag: General