https://github.com/rookiemonkey/git-cheat
bash scripts of shortened git commands grouped depending on their use cases
https://github.com/rookiemonkey/git-cheat
cheat cheatsheet cli git github open-source shell shell-scripting
Last synced: about 1 month ago
JSON representation
bash scripts of shortened git commands grouped depending on their use cases
- Host: GitHub
- URL: https://github.com/rookiemonkey/git-cheat
- Owner: rookiemonkey
- Created: 2020-12-20T11:32:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-21T00:23:50.000Z (over 5 years ago)
- Last Synced: 2025-02-08T12:12:55.446Z (over 1 year ago)
- Topics: cheat, cheatsheet, cli, git, github, open-source, shell, shell-scripting
- Language: Shell
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GIT-CHEAT!
Because of my boredom this afternoon, I decided to create some bash scripts to to shorten some github commands and group them depending on their common use cases :)
## WARNING
do this at your own risk! Bash files are needed to be copied/moved in ```/usr/bin``` so we can execute it anywhere in our machine. ```usr/bin``` contains binary executable files used by some of your programs. PLEASE BE CAREFUL!
These bash scripts doesn't handle error that good yet eg: scenarios like not passing enough parameters :)
## AUTO-IMPORT
#### NOTE: you can change the destination file on import.sh, however, please be aware that you also need to modify the $PATH variable
1. execute the import.sh
```$ ./import.sh```
## AVAILABLE COMMANDS
* ```$ glog```
* short-hand for git log with nice format
* PARAMS:
* no parameter
* ```$ gbadd arg1```
* creates a new branch switch to it
* lists all the branches available upon creating a new one
* PARAMS:
* arg1 is a branchname to be created
* ```$ gbrem arg1```
* removes a given branch
* lists all the branches available upon removing one
* PARAMS:
* arg1 is a branchname to be removed
* ```$ gbstash arg1```
* stashes the current changes on the current branch
* then applies the changes to the given branch
* PARAMS:
* arg1 is a branchname to apply the stashed changes
* ```$ gbswitch arg1```
* switches to the given branch
* PARAMS:
* arg1 is a branchname to use
* ```$ gbupdate arg1```
* update a branch based on master branch
* PARAMS:
* arg1 is a branchname to update
* ```$ ginit```
* short-hand for git init
* PARAMS:
* no parameter
* ```$ gpbranch arg1 arg2```
* add all, commit, then push to the given branch name
* PARAMS:
* arg1 is a branchname to push to
* arg2 is a comment enclosed inside ""
* ```$ gpmaster arg1```
* add all, commit, then push to the master branch
* PARAMS:
* arg1 is a comment enclosed inside ""
* ```$ gradd arg1 arg2```
* adds a remote repository
* PARAMS:
* arg1 is a remote repository name (eg: origin)
* arg2 is a remote repository url (eg: git@github.com:username/sample.git)
* ```$ grrem arg1```
* removes a remote repository
* PARAMS:
* arg1 is a remote repository name (eg: origin)
* ```$ gstatus```
* short-hand for git status
* PARAMS:
* no parameter
## ADDING A NEW BASH FILE
#### NOTE: these scripts uses bash as interpreter
1. create a shell file (filename.sh) inside the dir ```./src```
```$ touch ./src/filename.sh```
2. modify the permissions of the file to be executable
```$ sudo chmod +x ./src/filename.sh```
3. run the auto-importer, exit, and then respawn your terminal
```$ ./import.sh```
4. invoke the bash script using its file name anywhere on your machine.
```$ filename```