Use SSH

Make sure that you have added ssh pub key to your Github account, and the private ssh key to your .ssh dir in the terminal. See [[2021-09-16-generate-ssh-key-for-github-git-on-termux]]

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id\_ed25519

Create personal access token

  1. Create a personal access token (Login Github web - Settings - Developer Option), give permissions and copy the token.
  2. apt install gh
  3. gh auth login

(Use ssh)

  1. To logout: gh auth logout

To create a new repository

  1. gh repo create newrepo Answer its questions, paste code files, add and commit, push

Bonus:

To change a git URL origin

git remote set-url origin
[email protected]:username/newrespo.git
git push --set-upstream origin master