Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
January 30, 2023 04:23 pm GMT

Common Git commands

--globally configure username
$ git config --global user.name "JohnDoe"
$ git config user.name "JohnDoe"

--globally configure password
$ git config --global user.email "[email protected]"
$ git config user.email "[email protected]"

--Navigate to previous directory
$ cd ..

--navigate to the stated directory
$ cd My_Portal/ChannelsPortal

--Add a specific file
$ git add 'My_Portal_lattest.bak'

--Add all files
$ git add .

--Commit changes
$ git commit -m 'Db Commit'

--Add to the remote repository
$ git remote add origin https://github.com/JohnDoe/My_APIs.git

--Push to the master repository
$ git push -u origin main

$ git push origin master --force

ADD A SINGLE FILE
LENOVO@DESKTOP-PIVU MINGW64 /e/Learning/ReactJs (Main)
$ git init

LENOVO@DESKTOP-PIVU MINGW64 /e/Learning/ReactJs (master)
$ git add 'Intro_To_React.html'

LENOVO@DESKTOP-PIVU MINGW64 /e/Learning/ReactJs (master)
$ git commit -m "First React Commit:file"

LENOVO@DESKTOP-PIVU MINGW64 /e/Learning/ReactJs (master)
$ git branch -M main

LENOVO@DESKTOP-PIVU MINGW64 /e/Learning/ReactJs (main)
$ git remote add origin https://github.com/JohnDoe/ReactJS.git

LENOVO@DESKTOP-PIVU MINGW64 /e/Learning/ReactJs (main)
$ git push -u origin main

HOW TO CLONE FROM EXISTING REPO
$ git clone https://https://github.com/JohnDoe/Read.git(url to be cloned)
$ cd name-of-folder
$ git add .
$ git commit "comment"
$ git set-url https://https://github.com/JohnDoe/Tech.git(url to your repo)
$ git push -u origin main


Original Link: https://dev.to/johnodhiambo/common-git-commands-gb8

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To