Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/HaywardMorihara/gh-tidy
Github CLI extension for cleaning up your Git workspace to get ready for the day!
https://github.com/HaywardMorihara/gh-tidy
gh-extension
Last synced: 3 months ago
JSON representation
Github CLI extension for cleaning up your Git workspace to get ready for the day!
- Host: GitHub
- URL: https://github.com/HaywardMorihara/gh-tidy
- Owner: HaywardMorihara
- License: unlicense
- Created: 2021-08-27T11:53:11.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-17T03:27:48.000Z (9 months ago)
- Last Synced: 2024-06-22T08:36:09.529Z (5 months ago)
- Topics: gh-extension
- Language: Shell
- Homepage:
- Size: 750 KB
- Stars: 48
- Watchers: 3
- Forks: 4
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
- awesome-gh-cli-extensions - **tidy** - Extension for tidying your Git workspace. (Git)
README
# Github CLI Extension: Tidy
[Github CLI Extension](https://docs.github.com/en/github-cli/github-cli/creating-github-cli-extensions) for tidying your Git workspace!
![gh tidy demo](./gh-tidy-demo.gif)
`gh tidy` does several things:
* Checks out master/main and pulls the latest from remote origin
* Runs 'git gc' to clean up unnecessary files & optimize your local repo
* Checks your local branches for ones that show as merged to master, and asks for your permission to delete them
* Checks your local branches for ones that have their corresponding pull requests merged, and asks for your permission to delete them
* If flagged, rebases all your local branches to the latest master## Installation
```sh
gh extension install HaywardMorihara/gh-tidy
```## Updating
```sh
gh extension upgrade HaywardMorihara/gh-tidy
```## Usage
Simply run
```sh
gh tidy
```
and it will checkout master/main, pull the latest, and clean up branches for you (with your permission, of course).If your repo doesn't _have_ a master/main branch, you can specify your trunk branch with the `--trunk ` parameter
## Troubleshooting
If you get an error such as:
```sh
failed to run extension: fork/exec /.local/share/gh/extensions/gh-tidy/gh-tidy: permission denied
```
then try:
```sh
gh extension upgrade HaywardMorihara/gh-tidy
```This was the result of file permissions being ignored by Git. I fixed this in the repo with:
```sh
git config core.fileMode true
```
See [here](https://stackoverflow.com/questions/1580596/how-do-i-make-git-ignore-file-mode-chmod-changes) for more details.