Published in : 2022-03-03
Somebody pushed a branch called
git push our repository.
Now I'm trying to check out to
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
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.
Join our community and get the chance to solve your code issues & share your opinion with usSign up Now