Asterisk in zsh Git info
Asked Answered
S

2

9

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!

Selfgratification answered 24/5, 2021 at 9:38 Comment(0)
H
26

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

Horseshoe answered 21/6, 2021 at 13:55 Comment(8)
The stash is usually represented by $.Glasgo
It depends on your terminal, I use powerlevel10x which represents stash as * this may be useful for others.Horseshoe
P10k is not a terminal. It's a prompt theme for your shell.Glasgo
I'm leaving this answer here as it may help others, if you disagree please vote to close itHorseshoe
My last comment was not about disagreeing, but about your incorrect usage of terminology. You are right that the symbols mean something different in Powerlevel10k. I've now added a note about that to my answer.Glasgo
As for me I'm expecting stashed when I see asterisks (I do not know why. Someone trained me). But I know If something is stashed, then a '$' will be shown next to the branch name. Also sometimes git stash list returns nothing for powerlevel but git stash clear cleans asterisks from the prompt.Micromho
@MarlonRichert yes that's a fair point, noted for future ref.Horseshoe
Thank you so much, Neil! Those asterisks with numbers have been driving me INSANE!Moratorium
C
0

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

Centralia answered 4/8, 2021 at 18:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.