git apply patch不起作用:没有这样的文件或目录

时间:2019-05-27 21:31:11

标签: git

我们的存储库已从GitLab移至GitHub。我需要将一些更改从旧的工作存储库迁移到新的存储库。我有两个单独的克隆。

我跑了:git format-patch a3f98d38410c48be73a5fb4a6fa086c29ed6a7c1 --stdout > dan-changes.patch

创建补丁文件,然后将其移至其他克隆。

然后:

C:\Users\dbak\Projects\Flamenco.Flamenco-Firmware (dev-anom-stiction-test -> origin)
λ git apply -v dan-changes.patch
dan-changes.patch:793910: trailing whitespace.
                        virtual void format_error_message()const = 0;
dan-changes.patch:793911: trailing whitespace.

dan-changes.patch:793926: trailing whitespace.

dan-changes.patch:793943: trailing whitespace.

dan-changes.patch:793955: trailing whitespace.

Checking patch unit-tests/FlaAlgoTests/CMakeLists.txt...
error: unit-tests/FlaAlgoTests/CMakeLists.txt: No such file or directory
Checking patch unit-tests/FlaAlgoTests/flamenco_algorithms_gyro_anom_tests.cpp...
error: unit-tests/FlaAlgoTests/flamenco_algorithms_gyro_anom_tests.cpp: No such file or directory
Checking patch unit-tests/FlaAlgoTests/flamenco_algorithms_gyro_stiction_tests.cpp...
error: unit-tests/FlaAlgoTests/flamenco_algorithms_gyro_stiction_tests.cpp: No such file or directory
Checking patch unit-tests/FlaAlgoTests/flamenco_algorithms_tests_helpers.cpp...
Checking patch unit-tests/FlaAlgoTests/RealFlamencoData.csv...
Checking patch unit-tests/CMakeLists.txt...
Checking patch unit-tests/FlaAlgoTests/CMakeLists.txt...
error: unit-tests/FlaAlgoTests/CMakeLists.txt: No such file or directory
Checking patch unit-tests/FlaAlgoTests/CMakeLists.txt.in...
error: unit-tests/FlaAlgoTests/CMakeLists.txt.in: No such file or directory
Checking patch unit-tests/FlaAlgoTests/DataGenerator.py...
Checking patch unit-tests/FlaAlgoTests/OutputToXML.py...
Checking patch unit-tests/FlaAlgoTests/catch_test_runner.cpp...
Checking patch unit-tests/FlaAlgoTests/flamenco_algorithms_accel_anom_tests.cpp...
error: unit-tests/FlaAlgoTests/flamenco_algorithms_accel_anom_tests.cpp: No such file or directory
Checking patch unit-tests/FlaAlgoTests/flamenco_algorithms_accel_stiction_tests.cpp...
error: unit-tests/FlaAlgoTests/flamenco_algorithms_accel_stiction_tests.cpp: No such file or directory
Checking patch unit-tests/FlaAlgoTests/flamenco_algorithms_gyro_anom_tests.cpp...
error: unit-tests/FlaAlgoTests/flamenco_algorithms_gyro_anom_tests.cpp: No such file or directory
Checking patch unit-tests/FlaAlgoTests/flamenco_algorithms_gyro_stiction_tests.cpp...
error: unit-tests/FlaAlgoTests/flamenco_algorithms_gyro_stiction_tests.cpp: No such file or directory
Checking patch unit-tests/FlaAlgoTests/flamenco_algorithms_public_tests.cpp...
error: unit-tests/FlaAlgoTests/flamenco_algorithms_public_tests.cpp: No such file or directory
Checking patch unit-tests/FlaAlgoTests/flamenco_algorithms_tests_helpers.cpp...
Checking patch unit-tests/FlaAlgoTests/flamenco_algorithms_tests_helpers.h...
Checking patch unit-tests/FlaAlgoTests/test_runner.cpp...
error: unit-tests/FlaAlgoTests/test_runner.cpp: No such file or directory
Checking patch unit-tests/lib/csv.h...

因此,看来git apply不喜欢在此补丁中创建新文件的事实。这些都是在原始克隆中的a3f98d38410c48be73a5fb4a6fa086c29ed6a7c1中创建的文件。有什么方法可以覆盖此行为?还是我需要为新克隆中的每个新文件手动添加存根文件?

0 个答案:

没有答案