According to Pro Git book it is possible to apply patch file just to working directory, no changes in git database, Without these options, the command applies the patch only to files, and does not require them to be in a Git repository. Addressed files do not need to be under version control, not added to staged area. Nor the project's source tree needs to be a git repository.
I am not able to apply received patch file. The situation might be somehow specific. Below the details.
- All files covered by patch file are in Linux kernel source tree
- kernel source tree is a sub-sub-..-directory of bigger project
- As initially the kernel source tree is not a local git repository
- The git repository going to be done here is for whole project (of which the kernel source tree is a component) and only for purposes of applying patch files
- Whole project under ClearCase version control, snapshot view
- By default all files are read-only
git init
was carried out in parent directory of kernel source tree, means parent of kernel source tree includes.git/
kernel/
other project's components
git status
lists all subdirectories of kernel source tree parent dir as untracked files- patch-file was placed in a sub-dir of kernel source tree
- It can well be that the project's source state does not correspond to any of the two source states covered by patch file
<path>/kernel$ git apply -v --stat patch_files__view_private_files/my-patch-file.patch
results in
0 files changed, 0 insertions(+), 0 deletions(-)
Which prerequisite for successful application of patch file using git is not fulfilled in this environment? As for the situation above is git the good choice for applying patch files?