當在終端中使用git時,任何時候我做一個git命令時,我總是會得到用法,泛型選項等等。當我運行git時,是否有一個命令可以運行,只顯示我需要看到的東西而不是使用信息?這將幫助我在視覺上看到更多。謝謝。git終端最小顯示屏
下面是一個例子
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# css/
# index.html
# js/
nothing added to commit but untracked files present (use "git add" to track)
usage: git branch [options] [-r | -a] [--merged | --no-merged]
or: git branch [options] [-l] [-f] <branchname> [<start-point>]
or: git branch [options] [-r] (-d | -D) <branchname>
or: git branch [options] (-m | -M) [<oldbranch>] <newbranch>
Generic options
-v, --verbose show hash and subject, give twice for upstream branch
-t, --track set up tracking mode (see git-pull(1))
--set-upstream change upstream info
--color[=<when>] use colored output
-r act on remote-tracking branches
--contains <commit> print only branches that contain the commit
--abbrev[=<n>] use <n> digits to display SHA-1s
Specific git-branch actions:
-a list both remote-tracking and local branches
-d delete fully merged branch
-D delete branch (even if not merged)
-m move/rename a branch and its reflog
-M move/rename a branch, even if target exists
-l create the branch's reflog
-f, --force force creation (when already exists)
--no-merged <commit> print only not merged branches
--merged <commit> print only merged branches
什麼我問這裏是否有簡短的命令輸入命令時,這將有助於澄清一些房地產故一般選擇和具體的Git分支的行動並不總是出現。
編輯與來自混帳配置--get-regexp的 「別名」 輸出
alias.st status
alias.ci commit
alias.co checkout
alias.br branch
alias.l log --graph --pretty=format':%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ar%Creset'
alias.lol log --pretty=oneline --abbrev-commit --graph --decorate
alias.unstage reset HEAD
alias.staged diff --cached
alias.unstaged diff
alias.current-branch !git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||'
alias.track checkout -t
$ ps | grep $$
3406 ttys000 0:00.09 -bash
3492 ttys000 0:00.00 grep 3406
你看到這個任何時候你做一個git命令?聽起來像一個破碎的別名或別的東西。你能舉一個例子嗎? – 2012-04-02 01:31:06
@AbeVoelker - 我發佈了上面的輸出,我希望在終端中運行命令時隱藏選項。 – pertrai1 2012-04-02 09:05:07
你輸入的命令是什麼?它看起來像'git branch'的不正確用法。這可能來自一個糟糕的系統別名或git別名。請發佈這些命令的輸出:'alias'和'git config --get-regexp'alias。*「' – 2012-04-02 13:10:28