Skip to content

thelearn-tech/git-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 

Repository files navigation

git-cli

A tutorial on how to maintain repo with local repo aka cli pushing.

Contains

Step 1)

Creating a Personal token

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.

pa Token read org

Step 2)

Creating a SSH key

ssh Keygen [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"

Step 3)

Installing git and gh

Installation guide for git here

Installation guide for gh here

Installation on termux
pkg install git gh -y or
apt install git gh -y

Step 4)

GIT setup

get your email from here or Settings > Emails

If you have private email then your email will look some thing like this email


now type `git config --global user.name "youUserName"`

and type git config --global user.email "yourEmail"

like this git auth

change youUserName to your github user name like git config --global user.name "thelearn-tech" and do same for your email.

Step 5)

Authentication to github with gh

type gh auth login"

github.com

SSH

~/.ssh/id_rsa.pub

paste authentication token

img collage

Step 6)

clonning the Repository

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.gitis the repo u have cloned

Step 7)

pulling and commiting and pushing


setup img



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.

About

A basic tutorial on how to install and use git & gh

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published