Allow to restore/fetch file(s) from another branch
kwin opened this issue · comments
Description
As explained in https://stackoverflow.com/questions/2364147/how-to-get-just-one-file-from-another-branch both
git checkout <sourcebranch> -- <filepaths>
(https://git-scm.com/docs/git-checkout#Documentation/git-checkout.txt-emgitcheckoutem-f--ours--theirs-m--conflictltstylegtlttree-ishgt--ltpathspecgt82308203) works on the target branch as well asgit restore --source <sourcebranch> -- <filepaths>
(https://git-scm.com/docs/git-restore#Documentation/git-restore.txt---sourcelttreegt)
works on the CLI. Unfortunately there is no equivalent for either of those operations in EGit up till now
Motivation
In order to split up a branch into two separate ones it is often necessary to work based on files in another branch rather than on commits.
Alternatives considered
Using CLI
Additional context
No response
select branch/commit/ref > show in > history > scroll to wanted file in history view > check out this version
@Bananeweizen Thanks for the pointer, it would be helpful to explicitly add those file checkouts to https://github.com/eclipse-egit/egit/wiki/User-Guide#checking-out-an-existing-branch or a dedicated sibling section.