获取此错误:
Executing: git reset --soft HEAD~ && git restore --staged yarn.lock && git restore yarn.lock && yarn install && git add yarn.lock && git rebase --continue
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
[5/5] Building fresh packages...
success Saved lockfile.
✨ Done in 10.29s.
error: could not open '/Users/devinrhode2/repos/myco/tess1/.git/worktrees/tess3/rebase-merge/author-script' for reading: No such file or directory
error: you have staged changes in your working tree
If these changes are meant to be squashed into the previous commit, run:
git commit --amend
If they are meant to go into a new commit, run:
git commit
In both cases, once you're done, continue with:
git rebase --continue
error: could not commit staged changes.
error: cannot rebase: Your index contains uncommitted changes.
warning: execution failed: git reset --soft HEAD~ && git restore --staged yarn.lock && git restore yarn.lock && yarn install && git add yarn.lock && git rebase --continue
and made changes to the index and/or the working tree
You can fix the problem, and then run
git rebase --continue
hint: Could not execute the todo command
hint:
hint: exec git reset --soft HEAD~ && git restore --staged yarn.lock && git restore yarn.lock && yarn install && git add yarn.lock && git rebase --continue
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
我所要做的事情的精神实质上是从上一次提交(但在新的基础上)重新生成对yarn.lock文件的更改。简单地重新生成更改比验证更改容易得多。
发布于 2022-08-02 14:57:16
@Johan
看起来这个重基食谱看起来可能是这样:
pick 6a33e8ebe Run `yarn add eslint --dev`
exec LAST_MSG=$(git log -1 --format=%B 6a33e8ebe); git reset --soft HEAD~ && git restore --staged yarn.lock && git restore yarn.lock && yarn install && git add yarn.lock && git commit -m "$LAST_MSG"
当然,为LAST_MSG
实际获取散列的复杂性--我认为应该能够引用HEAD
tho。
UPDATE:实际上,理想的模式是命令有自己的单独提交,并执行:
drop bde6f678a Run `yarn prettier --write README.md .eslintrc.js`
exec yarn prettier --write README.md .eslintrc.js && git commit -am "Run `yarn prettier --write README.md .eslintrc.js`"
Git可能应该引入一个提交消息语法,如:
git commit -am "exec! yarn prettier --write README.md .eslintrc.js"
当重新建立基础时,它基本上会扩展到以下方面:
drop bde6f678a Run `yarn prettier --write README.md .eslintrc.js`
exec yarn prettier --write README.md .eslintrc.js && git commit -am "exec! yarn prettier --write README.md .eslintrc.js"
提交永远都不可能足够小!
https://stackoverflow.com/questions/73202146
复制相似问题