ingydotnet / git-subrepo

MIT License
3.18k stars 263 forks source link

Need to do a clean command before pull or push #601

Closed prrvchr closed 8 months ago

prrvchr commented 8 months ago

Hi, First of all thank you for this tool, I couldn't do without it... It's not really a bug, because it works very well like that, it's more to know if it's normal? Sometimes when I run the command (uno is the name of my subrepo):

git subrepo pull uno

I get the response:

git-subrepo: There is already a worktree with branch subrepo/uno. Use the --force flag to override this check or perform a subrepo clean to remove the worktree.

When I get such a response the only command that allows me to move forward is:

git subrepo clean uno

I get the response:

Removed branch 'subrepo/uno'.

Now we can say that everything is working well... Is this normal?

admorgan commented 8 months ago

This isn't that unusual. If you do something like a git subrepo branch or if there is ever a subrepo error it is likely that the worktree still exists so you do whatever action you wanted to do with the branch command or investigate what went wrong with the subrepo command that failed. This is a safe operation and should have got you back to where you want to be.

admorgan commented 8 months ago

If this happens regularly and you didn't have an error or use the branch command then there is a bug and a command history that can reproduce the issue would be appreciated.

prrvchr commented 8 months ago

Thank you for this quick response. No, this doesn't happen regularly and I've never used the branch command, I only use pull and push Where to find command history?

admorgan commented 8 months ago

That would be a feature of your shell, git subrepo does not store a history.

prrvchr commented 8 months ago

Ok thanks for the info, I will come back if necessary...