Asterisk in zsh Git info

Viewed 1028

I use my terminal to run stuff like npm run start while I use the terminal in VSCode for git commands. On my laptop, this worked perfectly, however after setting up zsh on my other device, there's something I've never noticed:

On my terminal: ~/Desktop/... | master *1 On VSCode's terminal: ~/Desktop/... | master *2

What do the numbers after master mean? This has caused me to pointlessly debug for 1 hour after releasing, if I do npm run start on my terminal, any changes on VSCode does not hot reload and apply the change. On the other hand, if I run npm run start in VSCode, it works normally.

It seems as though each shell is working on a different version of the current branch. Any idea what the asterisks mean? Thanks!

3 Answers

Depending on your prompt theme (I use powerlevel10k), this could indicate how many slots you have used in the stash. You can check this with:

git stash list

and if necessary remove them with

git stash clear

*2 usually (depending on your prompt theme) means that you have 2 modified files in your repo.

Most prompt themes use the same symbols as git-prompt.sh (which is distributed with git):

  • * unstaged
  • + staged
  • $ stash
  • % untracked files
  • < behind
  • > ahead
  • <> diverged
  • = no difference
  • | operation in progress
  • ? sparse checkout

Note, however, that the popular Powerlevel10k prompt theme uses these symbols in an entirely different way. Be warned.


The numbers can get out of sync if you don’t use your terminal for a while; the prompt is not updated when you’re not performing any actions in the terminal. Try pressing Enter or ControlL.

It seems as though each shell is working on a different version of the current branch.

That’s not possible; then it wouldn’t be the same branch. However, it’s entirely possible that you are working in two different repos. Type pwd in each terminal to view the full path and check if they’re different.

I came across this exact same issue, *1 in my case was "stashed" changes I kept. Removing the using GitKraken delete stash, worked.

Related