user image

Eslam Zedan
Published in : 2022-03-03

How to checkout to new created branch on bitbucket


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?


Shilpa Date : 2022-03-03

Best answers


Best answers


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

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

Tag: General

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

Tag: General

Convert Stored Procedure of Oracle to SQL Server
Publish date: 2022-03-02 | Comments: 1

Tag: General

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

Tag: General

Select from a query with peewee
Publish date: 2022-03-05 | Comments: 0

Tag: General

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

Tag: General