Help for this page

Select Code to Download


  1. or download this
    $ tree -f -a .
    .
    |-- ./Foo
    ...
        `-- ./Foo-old/one.txt
    
    3 directories, 4 files
    
  2. or download this
    $ cat Foo-new.patch
    diff -Npurd Foo-old/one.txt Foo-new/one.txt
    ...
    @@ -0,0 +1 @@
    +new file
    
  3. or download this
    $ cd Foo
    
    ...
    patching file one.txt
    patching file two.txt
    
  4. or download this
    $ patch -p0 -i../Foo-new.patch
    can't find file to patch at input line 4
    ...
    
    1 directory, 2 files
    
  5. or download this
    diff -Npurd emptyDir tmpFoo  > tmpFoo.patch
    
  6. or download this
    diff -Npurd emptyDir/Foo/one.txt tmpFoo/Foo/one.txt
    --- emptyDir/Foo/one.txt    1969-12-31 16:00:00.000000000 -0800
    +++ tmpFoo/Foo/one.txt    2012-08-16 08:21:35.609375000 -0700
    ...
    @@ -0,0 +1 @@
    +hi there
    
  7. or download this
    $ cd tmp2Foo
    
    ...
    `-- ./two.txt.rej
    
    0 directories, 4 files
    
  8. or download this
    $ patch -p1 -i ../tmpFoo.patch
    patching file Foo/one.txt
    ...
        `-- ./Foo-old/one.txt
    
    3 directories, 4 files
    
  9. or download this
    $ patch -p0 -i ../tmpFoo.patch
    patching file tmpFoo/Foo/one.txt
    ...
            `-- ./tmpFoo/Foo-old/one.txt
    
    7 directories, 8 files
    
  10. or download this
    $ patch -p0 -R -i ../tmpFoo.patch
    patching file tmpFoo/Foo/one.txt
    ...
        `-- ./Foo-old/one.txt
    
    3 directories, 4 files