I have a situation like this,
* 23e53d6 (master) ---> a_config_file (original)
* f4e4dd2 ...
* 6308fc5 ...
|
| * e52ec6b (hacky) ---> a_config_file (altered)
|/
* 23e53d6 ...
and I would like to reference a_config_file
on the hacky
branch, while being on any branch and without copying it, to be used for a command, such as:
$ awesome_tool --config=hacky-branch-version-of-a-config-file <...>
Is this even possible? Some solutions I looked into:
I know about
git restore --source=hacky a_config_file
but that copies that version of the file into the current working dir, overwriting the current one so it shows up ingit status
There is also
git show e52ec6b:a_config_file
but I can't use standard input or process substitution with the CLI tool of my choice so I would have to save the output (file,mkfifo
, etc.) and invoke that - which is basically the previous item
I'm aware of the following questions, but these don't seem to provide a solution to this question:
- How to get just one file from another branch
- How to retrieve a single file from a specific revision in Git?
Please let me know if I overlooked something!)