Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/octonato/oh-my-git
https://github.com/octonato/oh-my-git
bash github hacking
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/octonato/oh-my-git
- Owner: octonato
- Created: 2019-02-01T10:45:54.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2022-07-18T09:55:53.000Z (over 2 years ago)
- Last Synced: 2024-10-12T16:16:53.372Z (about 1 month ago)
- Topics: bash, github, hacking
- Language: Shell
- Homepage:
- Size: 43 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Oh-my-git
A collection of git scripts that I use to automate my workflow
## Requirements
Some commands requires extra libraries the GitHub CLI.
* `gh` - https://cli.github.com
* `complete` (a default function in bash)## Install
### Check out this repo
```bash
git clone [email protected]:octonato/oh-my-git.git
```* Add the bin folder to your PATH
* source `git-functions.sh` and `gh-functions.sh`
* define env variable: `GITHUB_SRC` (eg: GITHUB_SRC=/Users/renato)
* define env variable: `GITHUB_USER` (eg: GITHUB_USER=octonato)
* define env variable: `GH_USER_PREFIX` (eg: GH_USER_PREFIX=wip) - optional. This adds a prefix to each new branch.## Usage
Use `oh-my-git` to print the list of commands, alias, git extensions and git alias provided.
### Folder Structure
Some of the commands provided by `oh-my-git` expect your local clone to follow a certain folder structure:
```
$GITHUB_SRC
├── some-github-org
│ └── fancy-repo
│ └── master
├── another-org
│ ├── repo1
│ │ └── master
│ └── repo1
│ ├── bugfix-branch
│ └── master
└── octonato
└── oh-my-git
├── master
└── more-usage-docs```
### ghp
If you followed the convention described in [Folder Structure](#Folder-Structure) you can use `ghp ` to quickly navigate to a workbranch on your local clones useing autocompletion of the organization, repository and branch names:
```bash
$ ghp octo/oh-/
octonato/oh-my-git/doc-usage octonato/oh-my-git/master
octonato/oh-my-git/more-usage-docs
```### git clone-fork
Quickly clone and fork a git repository.
```
git clone-fork [email protected]:lagom/lagom.git
```**Note** only the `SSH` protocol (not `HTTPS`) is supported.