2017-11-13 12 views
0

一つのディレクトリからパッチを作成し、そのパッチを別のディレクトリに適用しようとしています。 。例について一つのディレクトリからgitパッチを作成し、そのパッチを別のディレクトリに適用できますか?

: 検討し、レポ1 /ローカル/ MNT /ワークスペース/ NEW_VERSION/sample_dir/は、ファイル1、ファイル2、およびファイル3を含有します。

repo-2 /local/mnt/workspace/old_version/には、repo-1で説明したのと同じファイルセットが含まれているとします。

ここでは、repo-1からパッチセットを作成し、パスの競合のためにエラーをスローするrepo-2にパッチを適用しようとしています。

私の要件を満たす方法はありますか?助けてください !このため

答えて

1

あなたはディレクトリを削除する-pを使用することができますし、--directory=<root>

-p<n> 
     Remove <n> leading slashes from traditional diff paths. The default is 1. 

    --directory=<root> 
     Prepend <root> to all filenames. If a "-p" argument was also passed, it is applied before prepending the new root. 

     For example, a patch that talks about updating a/git-gui.sh to b/git-gui.sh can be applied to the file in the working tree modules/git-gui/git-gui.sh by running git apply --directory=modules/git-gui. 
+0

はどうもありがとうございます!出来た。 –

関連する問題