patch

1. Apply patch foo.patch

The number in -p<num> controls how many directory levels to remove from the file paths inside the patch (at the top of foo.patch).

  • -p0 keep the full path unchanged
  • -p1 remove one directory level
  • -p2 remove two directory level etc
patch -p1 < foo.patch

2. Related nodes

3. References