Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个脚本可以使用shelljs.
shelljs
这是我的 LOC,它使用shelljs.
shell.exec('git cherry-pick commitid -X theirs'); Note: commitid = sha of commit I want to cherry-pick.
shelljs 抛出以下错误:
fatal: bad object: commitid
例如
fatal: bad object: 7854484884 (commitid)
我发现了这个问题。
我的项目结构如下所示:
project1 (git repo) cherrypick.js project2 (another git repo)
我想在 project2 中挑选一个提交并将其合并到不同的分支中。
但是编写的代码在project1中。因此我不得不添加这一行并且它有效。
shell.exec('cd project2'); shell.exec('git cherry-pick commitid -X theirs');