Commit e644634
committed
advice: add stashBeforeCheckout advice for dirty branch switches [GSOC]
Add a new advice type ADVICE_STASH_BEFORE_CHECKOUT to guide users
when they attempt to switch branches with local modifications that
would be overwritten by the operation.
The advice suggests using "git checkout -m" to carry local changes
over to the new branch in a single step.
The advice can be silenced with:
git config set advice.stashBeforeCheckout false
Changes:
- advice.h: add ADVICE_STASH_BEFORE_CHECKOUT enum value
- advice.c: add "stashBeforeCheckout" to advice_setting[] and implement
advise_on_checkout_dirty_files() function
- Documentation/config/advice.adoc: document the new advice key1 parent eb5639d commit e644634
1 file changed
Lines changed: 3 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
| 330 | + | |
331 | 331 | | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
| 332 | + | |
| 333 | + | |
341 | 334 | | |
0 commit comments