gpt4 book ai didi

linux - 我不能使用我的 git 别名

转载 作者:太空宇宙 更新时间:2023-11-04 10:26:50 25 4
gpt4 key购买 nike

如何使用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

我如何让它们工作?

最佳答案

git 别名不是那样使用的。 git别名用于git,意思是:

你的别名文件应该是这样的:

    [alias]

co = checkout

并像git co <args>一样使用

别名仅用于'git' 命令之后。

关于linux - 我不能使用我的 git 别名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41249649/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com