Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
GIT一行多命令错误_Git_Macos_Shell - Fatal编程技术网

GIT一行多命令错误

GIT一行多命令错误,git,macos,shell,Git,Macos,Shell,当我运行git add.&git commit-m“some fix”&git push它返回一个错误: <user> alexis$ git add . & git commit -m "Add some fix" & git push [1] 32595 [2] 32596 fatal: Unable to create'/Users/<user>/Desktop/project/.git/index.lock': File exists. Anoth

当我运行
git add.&git commit-m“some fix”&git push
它返回一个错误:

<user> alexis$ git add . & git commit -m "Add some fix" & git push
[1] 32595
[2] 32596
fatal: Unable to
create'/Users/<user>/Desktop/project/.git/index.lock': File exists.
Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.
Everything up-to-date
[1]-  Done                    git add .
[2]+  Exit 128                git commit -m "Add some fix"
alexis$git add.&git提交-m“添加一些补丁”&git推送
[1] 32595
[2] 32596
致命:无法
创建“/Users//Desktop/project/.git/index.lock”:文件存在。
另一个git进程似乎正在该存储库中运行,例如。
“git commit”打开的编辑器。请确保所有流程
已终止,然后重试。如果仍然失败,则会启动git进程
以前可能已在此存储库中崩溃:
手动删除该文件以继续。
一切都是最新的
[1] -完成git添加。
[2] +退出128 git提交-m“添加一些修复”
当我一个接一个地执行所有cmd时,没有问题。

shell中命令后的单符号(
&
)意味着在后台运行命令。从日志中,您可以在后台执行作业/进程,这使命令能够并行运行

<user> alexis$ git add . & git commit -m "Add some fix" & git push
[1] 32595
[2] 32596

使用双
和&
而不是一个。
[ -f "$file" ] && cat $file # cat the file only the file exists and regular file