git终端最小显示

  • 本文关键字:显示 终端 git 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

我在这里要问的是,在键入命令时,是否有一个短命令可以帮助清除一些不动产,这样Generic选项和Specific git分支操作就不会总是出现。

使用git-config的输出进行编辑--获取regexp"alias"

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 status --short(或git status -s)将显示较短的状态,类似于svn的状态显示。