https://github.com/dvnc0/git-destroyer
Git CLI Repository Manager
https://github.com/dvnc0/git-destroyer
cli-app command-line-app command-line-tool git php8
Last synced: 3 months ago
JSON representation
Git CLI Repository Manager
- Host: GitHub
- URL: https://github.com/dvnc0/git-destroyer
- Owner: dvnc0
- Created: 2023-08-27T21:22:13.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-09-08T04:28:44.000Z (almost 3 years ago)
- Last Synced: 2025-05-09T19:47:58.352Z (about 1 year ago)
- Topics: cli-app, command-line-app, command-line-tool, git, php8
- Language: PHP
- Homepage:
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A CLI Git Repository manager.
***FYI:***
***This is still a work in progress, unit testing, static analysis etc are not complete and this brief guide may change.***
## Usage
Download the Git Destroyer codebase or use Composer `composer create-project danc0/git-destroyer` and create an alias to `src/git-destroyer`. This will allow you to use this file in the CLI with an alias instead of having to type `php [PATH TO INSTALL]/src/git-destroyer`. Examples going forward will assume an alias of `git-destroyer` is set up.
## Basics
Git Destroyer offers robust help menu options `git-destroyer help` will show the available commands as well as some package info. The commands are shown below.
```txt
|Command |Description |
|------------------|----------------------------------------------------------|
|init |Initialize a project |
|clone |Clone the remote repository |
|new-branch |Create a new branch |
|update |Switch to a new branch |
|commit |Commit your changes |
|staging-push |Merge your changes into the staging branch and push them |
|live-push |Merge your changes into the live branch and push them |
|push |Push your changes to the remote |
|script |Run a script from the config |
|version |Prints the version information for git-destroyer |
```
Each of these commands also have their own help menus you can access using `--help` for example `git-destroyer commit --help`
```txt
Command: commit
About: Commit your changes
Usage:
|Arg |Alias |Description |Required |Is Flag |
|-----------------|------------|------------------------------------------|----------|---------|
|--add-all |-a |Add all files to the commit |False |True |
|--files=[VALUE] |-f=[VALUE] |CSV string of files to add to the commit |False |False |
|--local-only |-l |Only commit locally, do not push |False |True |
```
This shows you the usage, available flags, available options, and if they are required.
## Getting Started
Run `git-destroyer init` to create a new Git Destroyer config for your project. This will create both a config file and a hooks file.
## Hooks File
The hooks file is a JSON file that allows you to customize the run time of Git Destroyer.
```json
{
"new_branch": {
"pre": [],
"post": []
},
"commit": {
"pre": [],
"post": []
},
"staging": {
"pre": [],
"post": []
},
"live": {
"pre": [],
"post": []
},
"scripts": {
"example": "echo \"hello world\""
}
}
```
The `pre` and `post` arrays should be strings of bash commands you wish to run at those times. The `staging` and `live` keys are for merging code into your staging or production branch. The `scripts` section should be an object so you can call them using `git-destroyer script example`.
## Dev Environment Notes:
Need to create `src/stan.php` for PHPStan to find constants, this file should look like this:
```php