我在Windows上工作,感谢git专业人士提供的任何帮助。
PS G:\Solid\WebPortals> git status
On branch pos-event-waiver
nothing to commit, working tree clean
PS G:\Solid\WebPortals> git checkout pos-exchange-bill
error: Your local changes to the following files would be overwritten by checkout:
Site/WebPortals/assets/typescript/pos/cart/waiver.component.ts
Please commit your changes or stash them before you switch branches.
Aborting
答案 0 :(得分:0)
您的本地分支pos-event-waiver可能未设置为跟踪远程分支。要修复此问题并跟踪主分支,请执行以下操作:
git branch --set-upstream-to origin/master
立即尝试git status
获取当前分支的状态,然后根据需要提交或存储更改。