Quantcast
Channel: How to check out a remote Git branch? - Stack Overflow
Viewing all articles
Browse latest Browse all 97

Answer by Irfan wani for How do I check out a remote Git branch?

$
0
0

Though there are already a lot of answers and the commands below are supposed to work:

git pull or git fetch

git checkout <remote_branch>

But in my case, i was not able to get all the remote branches, though git pull or git fetch was not throwing any error, but when i ran git branch -a, it was showing my local branches and one remote branch, which was not even right.

To fix that, i simply removed the remote:git remote remove origin

then add the remote again:git remote add origin <remote_url>

Then, run the above commands:git pull or git fetch

and thengit checkout <remote_branch>


Viewing all articles
Browse latest Browse all 97

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>