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 fetchgit 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

Difference between frontend and backend user authentication
Publish date: 2022-02-12 | Comments: 2

Tag: General

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

Tag: General

Searching for free live chat service
Publish date: 2022-02-11 | Comments: 2

Tag: General

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

Tag: General

Help with sliding an image from the top of a stack
Publish date: 2022-02-12 | Comments: 1

Tag: General

docker elastic builder exited with code 127?
Publish date: 2022-02-27 | Comments: 2

Tag: General

Is it possible to git commit files without adding a message or comments?
Publish date: 2022-03-02 | Comments: 2

Tag: General