这表明
git status
无需提交任何内容,工作树干净
左行显示 git 行
我使用
webstorm
来更新我的项目。单击 Update Project
按钮运行这些命令:
14:42:17.357: [app] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false fetch origin --recurse-submodules=no --progress --prune
14:42:20.580: [app] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false -c core.commentChar= rebase origin/dev_core
它向我显示错误消息:
Rebasing (1/10)
Rebasing (2/10)
Rebasing (3/10)
error: Your local changes to the following files would be overwritten by merge:
src/main/test.node
Please commit your changes or stash them before you merge.
Aborting
hint: Could not execute the todo command
hint:
hint: pick 4162fea9e489405ac30633020ca1fe11ca22f6b3 feat: worker 引入 addon 并运行用例
hint:
hint: It has been rescheduled; To edit the command before continuing, please
hint: edit the todo list first:
hint:
hint: git rebase --edit-todo
hint: git rebase --continue
我已经运行了
git rebase --edit-todo
和 git rebase --continue
和 git rebase --skip
所有这些命令对我不起作用。
那么,我该如何变基呢?现在我可以合并,但线路不干净,这不是我想要的。
src/main/test.node
的本地更改将被覆盖git status
,你有一个干净的工作树,但变基仍然抱怨局部变化以下是逐步解决此问题的方法:
git branch backup-branch
git reset --hard HEAD
git rebase origin/v3.0/TPS
如果这仍然不起作用,这里有一个替代方法:
git stash -u # -u flag includes untracked files
git rebase origin/v3.0/TPS
如果您仍然遇到问题,可以尝试这种更彻底的方法:
# 1. Cancel the current rebase if it's in progress
git rebase --abort
# 2. Make sure we have latest changes
git fetch origin
# 3. Reset your branch to match origin/v3.0/TPS
git reset --soft origin/v3.0/TPS
# 4. Create a temporary commit of your changes
git commit -m "Temporary commit"
# 5. Now rebase your changes
git rebase origin/v3.0/TPS
如果这些都不起作用,作为最后的手段,您可以:
# Create new branch from latest remote
git checkout origin/v3.0/TPS -b new-branch
# Cherry-pick your commits one by one
git cherry-pick <commit-hash>