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 “johndoe@gmail.com”
$ git config user.email “johndoe@gmail.com”

–Navigate to prev…


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by JohnOdhiambo

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

--globally configure password
$ git config --global user.email "johndoe@gmail.com"
$ git config user.email "johndoe@gmail.com"

--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


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by JohnOdhiambo


Print Share Comment Cite Upload Translate Updates
APA

JohnOdhiambo | Sciencx (2023-01-30T16:23:10+00:00) Common Git commands. Retrieved from https://www.scien.cx/2023/01/30/common-git-commands/

MLA
" » Common Git commands." JohnOdhiambo | Sciencx - Monday January 30, 2023, https://www.scien.cx/2023/01/30/common-git-commands/
HARVARD
JohnOdhiambo | Sciencx Monday January 30, 2023 » Common Git commands., viewed ,<https://www.scien.cx/2023/01/30/common-git-commands/>
VANCOUVER
JohnOdhiambo | Sciencx - » Common Git commands. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/01/30/common-git-commands/
CHICAGO
" » Common Git commands." JohnOdhiambo | Sciencx - Accessed . https://www.scien.cx/2023/01/30/common-git-commands/
IEEE
" » Common Git commands." JohnOdhiambo | Sciencx [Online]. Available: https://www.scien.cx/2023/01/30/common-git-commands/. [Accessed: ]
rf:citation
» Common Git commands | JohnOdhiambo | Sciencx | https://www.scien.cx/2023/01/30/common-git-commands/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.