An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
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
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To