Commit ea508d8
committed
forgit: Add interactive git discard selector
Currently, discarding uncommitted changes requires two separate git
commands: git reset HEAD to unstage files and git restore to revert
working tree changes. This two-step process is error-prone and
cumbersome when dealing with multiple files, especially since there is
no built-in interactive selector for this combined operation.
Add forgit_discard (gdc) command that combines unstage and restore into
a single atomic operation with interactive file selection. This
streamlines the workflow for discarding changes while maintaining the
safety and visibility benefits of interactive selection through fzf.
The command includes a warning in documentation about its destructive
nature to prevent accidental data loss.
Signed-off-by: Javier Tia <floss@jetm.me>1 parent 2fa47a9 commit ea508d8
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
149 | 156 | | |
150 | 157 | | |
151 | 158 | | |
| |||
225 | 232 | | |
226 | 233 | | |
227 | 234 | | |
| 235 | + | |
228 | 236 | | |
229 | 237 | | |
230 | 238 | | |
| |||
290 | 298 | | |
291 | 299 | | |
292 | 300 | | |
| 301 | + | |
293 | 302 | | |
294 | 303 | | |
295 | 304 | | |
| |||
351 | 360 | | |
352 | 361 | | |
353 | 362 | | |
| 363 | + | |
354 | 364 | | |
355 | 365 | | |
356 | 366 | | |
| |||
0 commit comments