What are those red remote branches on Git?

2020-08-09 06:05发布

问题:

I'm new to git and trying to set up a repository.

I got two branches (master and xyz).

My workflow so far:

  1. change to specific branch, e.g. git checkout xyz
  2. make changes
  3. git add .
  4. git commit -am 'whatevermessage'
  5. git push origin xyz

Everything works so far. But when I git branch -a to view all my branches, I get the following output:

master
* xyz
remotes/origin/master
remotes/origin/xyz

while remotes/origin/master and remotes/origin/xyz are displayed in red color. I tried to figure out what the red color means but I couldn't find anything. So, assuming that red is equivalent to some kind of error: what does the red color mean and how can I fix it?

回答1:

Yellow is local branch while red is a remote branch.

By default:

[color "branch"]
    local = yellow
    remote = red
    plain = normal