diff options
| author | Owen Jacobson <owen.jacobson@grimoire.ca> | 2013-01-17 14:02:13 -0500 |
|---|---|---|
| committer | Owen Jacobson <owen.jacobson@grimoire.ca> | 2013-01-17 14:02:13 -0500 |
| commit | f69b0ce35e78f4336dc9e721e859690f8bf9613c (patch) | |
| tree | 9e97a908a0c903c432f088132c83e6fccb10a0b5 /wiki | |
| parent | 2fed7d1270544e7ffe38ca3266fe6719ace8bc47 (diff) | |
A caveat about using git-checkout to rebuild commits.
Diffstat (limited to 'wiki')
| -rw-r--r-- | wiki/git/survival.md | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/wiki/git/survival.md b/wiki/git/survival.md index 35ca572..d7a79c1 100644 --- a/wiki/git/survival.md +++ b/wiki/git/survival.md @@ -64,6 +64,11 @@ will screw you. Here are a few things I've picked up that have saved my bacon. * Gotcha: `git checkout -p` will do nothing for files that are being created. Use `git checkout`, instead, and edit the file if necessary. Thanks, Git. + * Gotcha: The new, clean branch must diverge from its upstream branch + (`origin/master`, in the example above) at exactly the same point, or + the diffs presented by `git checkout -p foo` will include chunks that + revert changes on the upstream branch since the "dirty" branch was + created. The easiest way to find this point is with `git merge-base`. ## Useful Resources |
