Skip to content

Lozsku/git_commands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 

Repository files navigation

Git push from Ubuntu Terminal

Notion Link

Git installation

sudo apt-get update
sudo apt-get install git
git config --global user.name "****"
git config --global user.email "****"

Git init

Go to the required Directory

cd <path>/repo
git init

Untitled

git remote add origin https://github.com/Lozsku/Alpha.git
git add .
git commit -m 'commit_message'
git branch -M main
git push -u origin main

It would automatically ask you for your username and password for GitHub. After entering the details, go to GitHub and refresh. The files would get added there.

Username for 'https://github.com' your_username

Password for 'https://your_username@github.com' : *******

But GitHub is no longer accepting account passwords when authenticating Git operations. You need to add a PAT (Personal Access Token) instead, and you can follow the below method to add a PAT on your system.

Create Personal Access Token on GitHub

From your GitHub account, go to Settings → Developer Settings → Personal Access Token → Tokens (classic) → click Generate token (classic)→ Fillup the form → Copy the generated Token, it will be something like ghp_sFhFsSHhTzMDreGRLjmks4Tzuzgthdvfsrta

Git Pull

git pull origin

Git Push

git add .
git commit -m "Your commit message"
git push origin

Username for 'https://github.com' your_username

Password for 'https://your_username@github.com' : PAT(personal access token)

Git Log

git log
git log --oneline

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors