为什么这个命令不起作用?
git diff | git --git-dir=/other/location/.git --work-tree=/other/location apply
Run Code Online (Sandbox Code Playgroud)
以下工作完美:
git diff > /tmp/my.patch
cd /other/location && git apply /tmp/my.patch
Run Code Online (Sandbox Code Playgroud)
/other/location 是当前目录的镜像.
通过管道命令,我得到了
error: patch failed: myfile.php:1
error: myfile.php: patch does not apply
Run Code Online (Sandbox Code Playgroud)