请给我状态git

时间:2013-03-13 16:00:42

标签: git git-status

有时候我输错了我的意思:

whunt$ git statsu
git: 'statsu' is not a git command. See 'git --help'.

Did you mean this?
    status

您可以通过更改git config中的help.autocorrect来告诉git执行它的建议。但有时候我错误地选择了破坏性的行为,而不是让git自动为我运行:

whunt$ git checkoot some/file
git: 'checkoot' is not a git command. See 'git --help'.

Did you mean this?
    checkout

所以真的,不是运行它想要的东西,而是让git告诉我当它不理解命令时的状态。有谁知道怎么做?

2 个答案:

答案 0 :(得分:3)

使用别名。

我正在使用zsh,只需在〜/ .zshrc中添加以下内容即可。如果仅使用Bash,则为〜/ .bashrc。

alias gs = 'git status'

现在你可以责怪你的键盘,如果还是错字。

添加

这是我的所有git别名,以避免你们更多错字:)

alias gs="git status"
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gcm='git commit -m'
alias gd='git diff'
alias go='git checkout '
alias gh='git hist'
alias gk='gitk --all&'
alias gx='gitx --all'

答案 1 :(得分:1)

除了Billy的shell别名之外,如果您愿意,还可以在git中创建别名。

git config --global alias.statsu status
git config --global alias.checkoot checkout

你觉得你听起来像往往会犯同样的拼写错误,所以或许为他们创建别名也不是太不方便或不现实。

相关问题