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

1
sudo apt install gh

Windows

1
winget install -e --id Github.cli

Setup

1
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

1
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

1
2
3
4
5
6
7
8
9
gcom() {
	git add .
	git commit -m "$1"
	}
lazyg() {
	git add .
	git commit -m "$1"
	git push
}

that’s it ✌🏽