3 Mar 2022
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?
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.