小编Ala*_*air的帖子

管git diff到git应用

为什么这个命令不起作用?

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)

git shell patch zsh

6
推荐指数
1
解决办法
3435
查看次数

标签 统计

git ×1

patch ×1

shell ×1

zsh ×1