当在终端中使用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-branch动作就不会总是出现。
使用git config的输出进行编辑--get-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
答案 0 :(得分:3)
git status --short
(或git status -s
)会显示较短的状态,类似于svn的状态显示。