feat(git): GitWorkingCopy.discard() to drop local work and come back to the remote state #71
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
qa:preview
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
quatrain/core#71
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Need
An application that commits and pushes one change at a time (for instance one commit per save, signed by the person who saved) needs a way out when the remote refuses the push because someone else pushed first: drop the local commit, come back to the remote state, and try again from there.
GitWorkingCopyhasrefresh()(fast-forward only) but no way to drop local work, so the working copy stays diverged and every laterrefresh()fails.Proposal
GitWorkingCopy.discard():Documented in the package README (EN, FR) with the commit / push / discard / retry pattern.