These shell scripts are crafted to enhance and streamline your Git
and GitHub CLI
workflows.
By leveraging the GitHub API, they allow you to perform essential GitHub operations directly from the terminal
.
Whether you need to create
, delete
, change visibility
, or manage collaborators
for your GitHub repositories, these scripts enable you to do so efficiently
without ever leaving the command line
.
- Packages: Ensure
git
andgh
are installed and properly configured.- GitHub CLI Guide: Gh Config
- Git Guide: Git Config
- Font:
Nerd Font
is recommended for optimal display.
- Clone the repository
git clone https://github.com/h471x/git_gh.git
- Navigate to the directory
cd git_gh
- Set execution permissions
chmod u+x {gh_scripts/*,git_scripts/*,setup/*}
- Run the installation script
./setup/install.sh
Once the scripts installed, you can check for them by running :
ls -l $(whereis sh | grep -o '/[^ ]*/bin' | head -n 1) | grep 'git_gh' | awk '{print $NF}' | xargs -n 1 basename | sed 's/\.sh$//'
- gh Scripts : GitHub operations management
Name | Usage |
---|---|
ghc |
Create a new repository |
ghd |
Delete an existing repository |
ghv |
View and toggle an existing repository's visibility |
gck |
Create a new branch locally and remotely |
gcln |
Clone a repository |
gbd |
Delete an existing branch locally and remotely |
ghadd |
Add a new collaborator to the repository by username |
ghdel |
Remove an existing collaborator from the repository by username |
ghcls |
List all collaborators for the repository by usernames |
- git Scripts : common git operations (optional)
Name | Usage |
---|---|
gad |
Add and Committing changes |
gcb |
Switch to the previously checked-out branch |
gdf |
Short for git diff |
glc |
Display the number of commits with last messages made by the current user |
gmb |
Merge the specified branch into the current branch |
gnm |
Rename the current branch |
gpsh |
Push local commits to its remote |
gpl |
Pull remote commits to local |
gst |
Short for git status -s |
grst |
Restore changes made |