Skip to content

Commit 9f1c84d

Browse files
authored
Merge pull request jwiegley#34 from bill-auger/master
latest git-branch-status script
2 parents 4485bcc + 4708bfa commit 9f1c84d

File tree

2 files changed

+281
-161
lines changed

2 files changed

+281
-161
lines changed

git-branch-status-subtree/README.md

Lines changed: 65 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,66 @@
1-
# git-branch-status
2-
A BASH script that prints out pretty git branch sync status reports
1+
# git-branch-status - print pretty git branch sync status reports
2+
3+
By default, the `git-branch-status` command shows the divergence relationship between branches for which the upstream differs from it's local counterpart.
4+
5+
A number of command-line switches exist, selecting various reports that compare any or all local or remote branches.
6+
37

48
![git-branch-status screenshot][scrot]
59

10+
11+
#### Notes regarding the screenshot above:
12+
13+
* This is showing the exhaustive '--all' report. Other reports are constrained (see 'USAGE' below).
14+
* The "local <-> upstream" section is itemizing all local branches. In this instance:
15+
* The local branch 'deleteme' is not tracking any remote branch.
16+
* The local branch 'kd35a' is tracking remote branch 'kd35a/master'.
17+
* The local branch 'knovoselic' is tracking remote branch 'knovoselic/master'.
18+
* The local branch 'master' is tracking remote branch 'origin/master'.
19+
* The "local <-> kd35a" section is itemizing all branches on the 'kd35a' remote. In this instance:
20+
* The local branch 'master' is 2 commits behind and 24 commits ahead of the remote branch 'kd35a/master'.
21+
* The "local <-> knovoselic" section is itemizing all branches on the 'knovoselic' remote. In this instance:
22+
* The local branch 'master' is 4 commits behind and 24 commits ahead of the remote branch 'knovoselic/master'.
23+
* The "local <-> origin" section is itemizing all branches on the 'origin' remote. In this instance:
24+
* The remote branch 'origin/delete-me' is not checked-out locally.
25+
* The remote branch 'origin/master' is tracked by the local branch 'master'.
26+
* The asterisks to the left of the local 'master' branch names indicate the current working branch.
27+
* The blue branch names indicate a tracking relationship between a local and it's upstream branch.
28+
* The "local <-> upstream" section relates tracking branches while remote-specific sections relate identically named branches. This distinction determines the semantics of the green "... synchronized" messages.
29+
* In the "local <-> upstream" section, this indicates that all local branches which are tracking an upstream are synchronized with their respective upstream counterparts.
30+
* In remote-specific sections, this indicates that all local branches which have the same name as some branch on this remote are synchronized with that remote branch.
31+
* In single branch reports, this indicates that the local branch is tracking an upstream branch and is synchronized with it's upstream counterpart.
32+
* In arbitrary branch comparison reports, this indicates that the two compared branches are synchronized with each other.
33+
34+
635
```
736
USAGE:
837
938
git-branch-status
10-
git-branch-status [-a | --all]
11-
git-branch-status [-b | --branch] [branch-name]
12-
git-branch-status [-d | --dates]
13-
git-branch-status [-h | --help]
14-
git-branch-status [-r | --remotes]
15-
git-branch-status [-v | --verbose]
39+
git-branch-status [ base-branch-name compare-branch-name ]
40+
git-branch-status [ -a | --all ]
41+
git-branch-status [ -b | --branch ] [filter-branch-name]
42+
git-branch-status [ -d | --dates ]
43+
git-branch-status [ -h | --help ]
44+
git-branch-status [ -l | --local ]
45+
git-branch-status [ -r | --remotes ]
46+
git-branch-status [ -v | --verbose ]
47+
1648
1749
EXAMPLES:
1850
19-
# show only branches for which upstream HEAD differs from local
51+
# show only branches for which upstream differs from local
2052
$ git-branch-status
2153
| collab-branch | (behind 1) | (ahead 2) | origin/collab-branch |
2254
| feature-branch | (even) | (ahead 2) | origin/feature-branch |
2355
| master | (behind 1) | (even) | origin/master |
2456
25-
# show all branches - even those with no upstream or no local and those up-to-date
57+
# compare two arbitrary branches (either local and either remote)
58+
$ git-branch-status local-arbitrary-branch fork/arbitrary-branch
59+
| local-arbitrary-branch | (even) | (ahead 1) | fork/arbitrary-branch |
60+
$ git-branch-status fork/arbitrary-branch local-arbitrary-branch
61+
| fork/arbitrary-branch | (behind 1) | (even) | local-arbitrary-branch |
62+
63+
# show all branches - including those synchronized, non-tracking, or not checked-out
2664
$ git-branch-status -a
2765
$ git-branch-status --all
2866
| master | (even) | (ahead 1) | origin/master |
@@ -53,11 +91,18 @@ EXAMPLES:
5391
$ git-branch-status --help
5492
"prints this usage message"
5593
56-
# show all remote branches - even those with no local
94+
# show all local branches - including those synchronized or non-tracking
95+
$ git-branch-status -l
96+
$ git-branch-status --local
97+
| master | (even) | (ahead 1) | origin/master |
98+
| tracked-branch | (even) | (even) | origin/tracked-branch |
99+
| local-branch | n/a | n/a | (no upstream) |
100+
101+
# show all remote branches - including those not checked-out
57102
$ git-branch-status -r
58103
$ git-branch-status --remotes
59-
| master | (behind 1) | (even) | a-remote/master |
60-
| (no local) | n/a | n/a | a-remote/untracked-branch |
104+
| master | (behind 1) | (even) | a-remote/master |
105+
| (no local) | n/a | n/a | a-remote/untracked-branch |
61106
62107
# show all branches with timestamps (like -a -d)
63108
$ git-branch-status -v
@@ -67,9 +112,12 @@ EXAMPLES:
67112
| 1999-12-31 tracked | (even) | (even) | 2000-01-01 origin/tracked |
68113
```
69114

70-
_NOTE: please direct comments, bug reports, feature requests, or PRs to the upstream repo:
71-
[https://github.com/bill-auger/git-branch-status/issues/][issues]_
115+
116+
_NOTE: please direct comments, bug reports, feature requests, or PRs to one of the upstream repos:_
117+
* [https://github.com/bill-auger/git-branch-status/issues/][github-issues]
118+
* [https://notabug.org/bill-auger/git-branch-status/issues/][notabug-issues]
72119

73120

74-
[scrot]: http://bill-auger.github.io/git-branch-status-scrot.png "git-branch-status screenshot"
75-
[issues]: https://github.com/bill-auger/git-branch-status/issues/
121+
[scrot]: http://bill-auger.github.io/git-branch-status-scrot.png "git-branch-status screenshot"
122+
[github-issues]: https://github.com/bill-auger/git-branch-status/issues/
123+
[notabug-issues]: https://notabug.org/bill-auger/git-branch-status/issues/

0 commit comments

Comments
 (0)