X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=Documentation%2Fgit-show-branch.txt;h=ba5313d51f8ba8380bd5519bf0c15a491a9bc83a;hb=08fbb136f7440eac96f4e4396316aff36526f299;hp=5b76f3b99e2f3a9d0ecc9357117baa1491d4879e;hpb=89438677abaae1a8ffc3c0905f3355a590da7bf4;p=git.git diff --git a/Documentation/git-show-branch.txt b/Documentation/git-show-branch.txt index 5b76f3b99..ba5313d51 100644 --- a/Documentation/git-show-branch.txt +++ b/Documentation/git-show-branch.txt @@ -3,11 +3,15 @@ git-show-branch(1) NAME ---- -git-show-branch - Show branches and their commits. +git-show-branch - Show branches and their commits SYNOPSIS -------- -'git-show-branch [--all] [--heads] [--tags] [--topo-order] [--more= | --list | --independent | --merge-base] [--no-name | --sha1-name] [ | ]...' +[verse] +'git-show-branch' [--all] [--remotes] [--topo-order] [--current] + [--more= | --list | --independent | --merge-base] + [--no-name | --sha1-name] [--topics] [ | ]... +'git-show-branch' (-g|--reflog)[=[,]] [--list] [] DESCRIPTION ----------- @@ -18,6 +22,9 @@ and/or $GIT_DIR/refs/tags) semi-visually. It cannot show more than 29 branches and commits at a time. +It uses `showbranch.default` multi-valued configuration items if +no nor is given on the command line. + OPTIONS ------- @@ -31,9 +38,16 @@ OPTIONS branches under $GIT_DIR/refs/heads/topic, giving `topic/*` would show all of them. ---all --heads --tags:: - Show all refs under $GIT_DIR/refs, $GIT_DIR/refs/heads, - and $GIT_DIR/refs/tags, respectively. +-r|--remotes:: + Show the remote-tracking branches. + +-a|--all:: + Show both remote-tracking branches and local branches. + +--current:: + With this option, the command includes the current + branch to the list of revs to be shown when it is not + given on the command line. --topo-order:: By default, the branches and their commits are shown in @@ -41,6 +55,11 @@ OPTIONS appear in topological order (i.e., descendant commits are shown before their parents). +--sparse:: + By default, the output omits merges that are reachable + from only one tip being shown. This option makes them + visible. + --more=:: Usually the command stops output upon showing the commit that is the common ancestor of all the branches. This @@ -50,7 +69,7 @@ OPTIONS tree. --list:: - Synomym to `--more=-1` + Synonym to `--more=-1` --merge-base:: Instead of showing the commit list, just act like the @@ -70,6 +89,22 @@ OPTIONS of "master"), name them with the unique prefix of their object names. +--topics:: + Shows only commits that are NOT on the first branch given. + This helps track topic branches by hiding any commit that + is already in the main line of development. When given + "git show-branch --topics master topic1 topic2", this + will show the revisions given by "git rev-list {caret}master + topic1 topic2" + +--reflog[=[,]] []:: + Shows most recent ref-log entries for the given + ref. If is given, entries going back from + that entry. can be specified as count or date. + `-g` can be used as a short-hand for this option. When + no explicit parameter is given, it defaults to the + current branch (or `HEAD` if it is detached). + Note that --more, --list, --independent and --merge-base options are mutually exclusive. @@ -78,13 +113,14 @@ OUTPUT ------ Given N , the first N lines are the one-line description from their commit message. The branch head that is -pointed at by $GIT_DIR/HEAD is prefixed with an asterisk '*' -character while other heads are prefixed with a '!' character. +pointed at by $GIT_DIR/HEAD is prefixed with an asterisk `*` +character while other heads are prefixed with a `!` character. Following these N lines, one-line log for each commit is displayed, indented N places. If a commit is on the I-th -branch, the I-th indentation character shows a '+' sign; -otherwise it shows a space. Each commit shows a short name that +branch, the I-th indentation character shows a `+` sign; +otherwise it shows a space. Merge commits are denoted by +a `-` sign. Each commit shows a short name that can be used as an extended SHA1 to name that commit. The following example shows three branches, "master", "fixes" @@ -92,7 +128,7 @@ and "mhf": ------------------------------------------------ $ git show-branch master fixes mhf -! [master] Add 'git show-branch'. +* [master] Add 'git show-branch'. ! [fixes] Introduce "reset type" flag to "git reset" ! [mhf] Allow "+remote:local" refspec to cause --force when fetching. --- @@ -106,13 +142,40 @@ $ git show-branch master fixes mhf + [mhf~6] Retire git-parse-remote. + [mhf~7] Multi-head fetch. + [mhf~8] Start adding the $GIT_DIR/remotes/ support. -+++ [master] Add 'git show-branch'. +*++ [master] Add 'git show-branch'. ------------------------------------------------ These three branches all forked from a common commit, [master], whose commit message is "Add 'git show-branch'. "fixes" branch adds one commit 'Introduce "reset type"'. "mhf" branch has many -other commits. +other commits. The current branch is "master". + + +EXAMPLE +------- + +If you keep your primary branches immediately under +`$GIT_DIR/refs/heads`, and topic branches in subdirectories of +it, having the following in the configuration file may help: + +------------ +[showbranch] + default = --topo-order + default = heads/* + +------------ + +With this, `git show-branch` without extra parameters would show +only the primary branches. In addition, if you happen to be on +your topic branch, it is shown as well. + +------------ +$ git show-branch --reflog='10,1 hour ago' --list master +------------ + +shows 10 reflog entries going back from the tip as of 1 hour ago. +Without `--list`, the output also shows how these tips are +topologically related with each other. Author