A tutorial on how to maintain repo with local repo aka cli pushing.
- Authentication
- Clonning
- Managing repo
create a Public Access Token from here or go to Settings > Developer Settings > Personal Access Token
and create a token with a minimum of full repo
and full admin:org
and full admin:public_key
permission.
[I am using my public mail for this demo, you can use any thing else]
ssh-keygen -t rsa -b 4096 -C "your pass phrase"
Installation guide for git here
Installation guide for gh here
Installation on termux
pkg install git gh -y
or
apt install git gh -y
get your email from here or Settings > Emails
If you have private email then your email will look some thing like this
now type `git config --global user.name "youUserName"`
and type git config --global user.email "yourEmail"
change youUserName to your github user name like git config --global user.name "thelearn-tech"
and do same for your email.
type gh auth login"
github.com
SSH
~/.ssh/id_rsa.pub
paste authentication token
git clone [email protected]:yourUserName/yourRepo.git
[this is SSH clonning]
if you have cloned repository with https [git clone https://github.com/yourUserName/yourRepo
]
then before git push
you have to specify the remote url with git remote set-url origin [email protected]:username/repo.git
,
here username/repo.git
is the repo u have cloned
git init
then git pull
git pull
before adding or changing any files. It's very important!!
now add file or change existing one as a update.
I added a file called example.txt
now if you do git status
then you will see untracked file
adding the file git add example.txt
here example.txt
is file name to be added .
To add all files use git add .
.
means all files in that directory.
if you do git status
now then it will show new file:
now commit with git commit -m "pushing file in cli"
here -m
in git commit -m
stands for comment like git commit -m "comment"
simple do git push
And done.