Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: git/git
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: someonewithpc/git
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 5 files changed
  • 1 contributor

Commits on Mar 14, 2023

  1. restore: add restore.defaultDestination to configure what gets updated

    `git restore` takes `--worktree` and/or `--staged` options to specify
    which one of the working tree files and/or the index entries are
    updated. With neither option, the command, by default, updates the
    working tree files.
    
    If a user attempts to reset the index entries from HEAD, they may, by
    mistake, run `git restore` without the `--staged` option. When such a
    mistake happens, the work made in the working tree files that are not
    yet added to the index will be forever lost. This patch is intended to
    mitigate this. This is a trade-off between lost worktree changes,
    which may not be present anywhere else, and lost index modifications,
    which can be recreated.
    
    Introduce the `restore.defaultDestination` configuration variable,
    which can be set to one of "both", "index", or "worktree", useful for
    users who want to set it to "index" to avoid touching the working tree
    files by mistake. They now force themselves to use the "--worktree"
    option explicitly when they want to restore the working tree files.
    
    Signed-off-by: Hugo Sales <[email protected]>
    someonewithpc committed Mar 14, 2023
    Configuration menu
    Copy the full SHA
    7b7f7ab View commit details
    Browse the repository at this point in the history
Loading