Mansoor Barri

Better Way To Use GitHub

Commandline for Github is complicated and complex however a tool called gh makes git so much easier on commandline and makes using Github that much quicker and easy.

Install

Debian

sudo apt install gh

Windows

winget install -e --id Github.cli

Setup

gh auth login

Follow the prompts but choose SSH as authentication method. You can use steps from mansoorbarri.com/ssh-keys/ to generate SSH keys for github.

Set your repo to use GH auth

git remote set-url origin [email protected]:mansoorbarri/website.git

change “mansoorbarri/website.git” to your repo name*

Bash Alias

You can add aliases when using linux to make it much more alias, I have added the following lines in my ~/.bashrc

gcom() {
	git add .
	git commit -m "$1"
	}
lazyg() {
	git add .
	git commit -m "$1"
	git push
}

that’s it ✌🏽