如何使用git别名?我无法使用我的git别名
我在~/.gitconfig
配置它们:
[alias]
g = "git"
go = "git checkout"
我可以看到他们git config --get-regexp alias
:
alias.g git
alias.go git checkout
但是当我尝试使用它们,它显示以下内容:
$ g
g: command not found
$ go
The program 'go' is currently not installed. You can install it by typing:
sudo apt install golang-go
我如何让他们工作?
你在你的本地回购'config'文件有一个别名? –
@JakeHenningsgaard,我不知道。如果我这样做,我可以在不调用'git'之前调用别名? – William
我在我的全局'.gitconfig'文件中设置了别名(g =“git”'),它工作正常。然后,我在本地git repo'config'文件('g =“ls”')中创建了一个别名。这本地的覆盖全球。这不能解决你的问题,但它可能是一个开始。 –