Skip to content
  • Duy Nguyen's avatar
    config: add --move-to[-regexp] · 49e6e3a3
    Duy Nguyen authored
    This option can be used to move one or multiple variables from one
    place to another, e.g. to move some aliases from repo config to user
    config, or from repo config to per-worktree config.
    
    This will be useful for moving config variables around when
    extensions.worktreeConfig is enabled. E.g.
    
        git config --local --move-to --worktree core.worktree
        git config --local --move-to-regexp --worktree 'submodule\..*\..*'
    
    The implementation is definitely not the best. We could lock both
    source and destination before the move, and perhaps edit these files
    just once instead of once per key. But it adds a lot more complication
    to config write code. Let's stay with something simple. We can
    optimize it later.
    49e6e3a3