Re: BUG: Git path --config doesn't work with ~ symbol

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You're right, "notepad ~/test.txt" doesn't work either.
I figured out a workaround:
[alias]
    cfg = "!git config --file $(echo ~)/git-settings/.gitconfig "
However what confuses me is that I also have
[core]
    hooksPath = ~/git-settings/hooks
and that ~ works. So why doesn't it work in config --file?

On Wed, May 5, 2021 at 9:35 PM Jeff King <peff@xxxxxxxx> wrote:
>
> On Wed, May 05, 2021 at 09:30:21PM +0300, Theodor Negrescu wrote:
>
> > I'm using powershell, but usually ~ works there. Typing "cd ~" would
> > work for example.
> > Also I tried using the command as an alias and it still didn't work.
>
> I don't know anything about powershell, but generally "cd" is a builtin
> to the shell (because it is impacting the shell's environment). So it
> may be that powershell "cd" expands "~" itself, but that the shell
> doesn't expand it for executed commands.
>
> There are some Windows folks who hang out on this list, so you may get a
> better response. But you might also ask in the Git for Windows mailing
> list:
>
>   https://groups.google.com/g/git-for-windows
>
> -Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux