Changes between Version 77 and Version 78 of HowToGit


Ignore:
Timestamp:
11/03/19 08:00:38 (5 years ago)
Author:
neteler
Comment:

example improved

Legend:

Unmodified
Added
Removed
Modified
  • HowToGit

    v77 v78  
    142142=== Applying a diff file locally ===
    143143
    144 Patching local repo with `git`:
     144Downloading a pull request as a diff file (example):
     145
     146{{{
     147cd path/to/grass_git/
     148
     149# use the PR number and simply add .diff to the URL
     150wget https://github.com/OSGeo/grass/pull/174.diff
     151}}}
     152
     153Patching local repo with `git` (continuing with example diff):
    145154
    146155{{{
    147156# first the stats about the patch (see what would be changed)
    148 git apply --stat  grass_code_changes.diff
    149 
    150 # dry run to detect errors (should be none):
    151 git apply --check grass_code_changes.diff
     157git apply --stat 174.diff
     158
     159# dry run to detect errors (should show no output, i.e. no errors):
     160git apply --check 174.diff
    152161
    153162# apply patch locally, continue committing as usual
    154 git apply grass_code_changes.diff
     163git apply 174.diff
    155164git status
    156 # ... commit etc.
    157 
    158 # FYI - undo a local patch:
     165# ... now comment on PR in GitHub, etc.
     166
     167# FYI - here how to undo a local patch:
    159168git apply --reverse grass_code_changes.diff
    160169}}}