Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple alias not working #5218

Closed
elzibubble opened this issue Oct 20, 2024 · 3 comments
Closed

Simple alias not working #5218

elzibubble opened this issue Oct 20, 2024 · 3 comments
Labels

Comments

@elzibubble
Copy link

  • [*] I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.47.0.windows.1
cpu: x86_64
built from commit: d53e4648cb65eb75dd8d8a093d17400a18a9a15d
sizeof-long: 4
sizeof-size_t: 8
shell-path: D:/git-sdk-64-build-installers/usr/bin/sh
feature: fsmonitor--daemon
libcurl: 8.10.1
OpenSSL: OpenSSL 3.2.3 3 Sep 2024
zlib: 1.3.1
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.22631.4317]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: VIM
Custom Editor Path:
Default Branch Option: main
Path Option: CmdTools
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Rebase
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Enabled
Enable FSMonitor: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Not that I know of.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

MINGW64 bash

$ env | grep GIT
GIT_CONFIG=/e/Dropbox/gitconfig
$ git config list --show-origin
file:E:/Dropbox/gitconfig       alias.co=checkout
$ git config alias.co
checkout
$ git co
git: 'co' is not a git command. See 'git --help'.
$ git config alias.yo yooo
$ git yo
git: 'yo' is not a git command. See 'git --help'.
  • What did you expect to occur after running these commands?

I expected git checkout to run and then git yooo to be unrecognised.

  • What actually happened instead?

The alias failed to resolve and git rejected git co as an unrecognized command.
git yo also failed to resolve to git yooo.

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

n/a

@elzibubble
Copy link
Author

#5184 #4465 might be relevant but they're more specialised. I'm fully willing to believe I've stuffed something up here but darned if I can see what.

@dscho
Copy link
Member

dscho commented Oct 20, 2024

GIT_CONFIG=/e/Dropbox/gitconfig

As per the documentation:

GIT_CONFIG
If no --file option is provided to git config, use the file given by GIT_CONFIG as if it were provided via --file. This variable has no effect on other Git commands, and is mostly for historical compatibility; there is generally no reason to use it instead of the --file option.

In other words: This behavior of Git is by design, and it is not specific to Git for Windows.

@dscho dscho closed this as not planned Won't fix, can't repro, duplicate, stale Oct 20, 2024
@dscho dscho added the question label Oct 20, 2024
@elzibubble
Copy link
Author

Goshdangit, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants