https://github.com/alicederyn/gittools
CLI tools to get more out of git
https://github.com/alicederyn/gittools
git
Last synced: 8 months ago
JSON representation
CLI tools to get more out of git
- Host: GitHub
- URL: https://github.com/alicederyn/gittools
- Owner: alicederyn
- Created: 2016-01-26T10:56:20.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2024-09-25T10:49:32.000Z (about 1 year ago)
- Last Synced: 2025-02-02T01:45:19.246Z (10 months ago)
- Topics: git
- Language: Python
- Homepage:
- Size: 296 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Alice's git tools
=================
This project contains a set of git CLI tools maintained by [alicederyn]. The most stable is `git graph-branch`, which displays a clean tree of your local git repository's branches, including forks and merges, whether the branch is in sync with origin (GitHub only), and whether tests are currently passing in CI.
[alicederyn]: https://github.com/alicederyn
To install the tools, use [pipx]:
```bash
pip install pipx
export PATH="$PATH:$HOME/.local/bin"
pipx install git+https://github.com/alicederyn/gittools.git
```
[pipx]: https://pipxproject.github.io/pipx/
* [git graph-branch](#git-graph-branch)
* [git pr](#git-pr)
git graph-branch
----------------
Usage: git graph-branch [options]
Symbols:
π· This branch is in sync with a remote of the same name
πΆ This branch is out of sync with a remote of the same name
β A CI build is in progress for this branch
π A CI build has succeeded for this branch
π₯ A CI build has failed for this branch
Options:
-h --help Show this screen.
-w, --watch Continue to watch for git repo changes after printing the graph.
--profile Profiles the app.
-l, --local Only display information available from the local git repo.
Continuous integration results will not be fetched.
This tool is optimized for [the Hack font](https://github.com/source-foundry/Hack), and may not look as good with other font choices.
To get the best out of git graph-branch, I recommend a few configuration changes to your git checkout (`/path/to/repo/.git/config`, or `~/.gitconfig` if you would like to make these changes to every checkout); these will also give you better defaults for several git commands.
[branch]
autosetupmerge = always # sets upstream information when you run git checkout -b
[remote]
pushdefault = origin # plain git push will continue to work as expected
[gc]
auto = 100000 # keeps branch history for longer
[pull]
rebase = true # git graph-branch assumes you always rebase remote changes
[push]
default = simple # plain git push will continue to work as expected
If you have not used these defaults before, you may want to set up upstream information for your existing branches as a one-off. For instance, if `feature/foo` is going to be applied to `develop`, run `git branch feature/foo --set-upstream-to=develop`. Once you have made the config changes above, `git checkout -b feature/foo` will set this upstream information for you when you create the branch.
git graph-branch will then use this upstream information to determine a tree structure for your branches. For instance, you might see something like:
β cleanup/immutables π· π₯
β¬ feature/java.8
βΌ feature/herc.strategy.api.plugin π· π
βΌ feature/no.more.internal.cluster.dispatch.connection π· π
ββΆβ΄ feature/distTar-unbreakable π· π
β΄ develop πΆ π β‘ unmerged
β workspace
In this case, `feature/java.8` is branched off `feature/herc.strategy.api.plugin`, which is branched off `feature/no.more.internal.cluster.dispatch.connection`, which itself is branched off of `develop` (and all four are passing CI tests!).
git pr
------
(Mac only)
Opens the browser to a GitHub page for creating a new PR for this branch, using upstream as the target branch.