-
Notifications
You must be signed in to change notification settings - Fork 376
Open
Labels
duplicateThis issue or pull request already existsThis issue or pull request already exists
Description
Fork allows branch switching without applying anything to the pending changes. I think it works this way (copied from the Brave search AI summary):
Git switch with uncommitted changes:
- If the changes in your working directory do not conflict with the target branch (i.e., the files are identical or the changes are in untracked files), Git will allow the switch and preserve your changes in the working tree.
- If the changes conflict (e.g., a tracked file is modified in both branches), Git will refuse the switch and show an error:
error: Your local changes to the following files would be overwritten by checkout.
Stashing can force you into a merging state and it happened to me various times that accidentally I lost changes (user error). Most of the time I prefer seeing errors if "clean branch switches" do not work, it tells me I should really first commit/discard/stash the pending changes depending on what the changes are.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
duplicateThis issue or pull request already existsThis issue or pull request already exists