It seems that we could use
git branch -r
or
git branch -a
to see remote branches. However, when I git clone
my repo on GitHub, and then added a branch on GitHub, and tried the commands above, I can't see the new branches on my local machine. I even edited a file and committed on the new branch, and still wasn't able to see the new branch on the local machine using those commands.
Until I used a git pull
, then a git branch -a
will show that new branch (but a git branch
will not). But I think I might not want to use a git pull
as it will update my files locally. In that case, can I see all remote branches?
(also, I will see the new branch as remotes/origin/wah-la-la
by using git branch -a
, and then only after I do a git checkout wah-la-la
, then from this point on, I will be able to see both master
and wah-la-la
when I do a git branch
. Can't I see wah-la-la
before I do a checkout?)