Uploaded by Umesh Kumari

GitCommand

advertisement
Git Important Command
1) $ git --version
2) git version 2.33.0.windows.2
3) git config --global user.name "Umesh Kumari"
4) git config --global user.email “umeshkumari123029@gmail.com”
5) $ git config --global user.email
6) umeshkumari123029@gmail.com
7) git config --global –edit
8) esc :wq
9) mkdir LetsStartGit
10)
cd LetsStartGit/
11)
git init
12)
ls -a , ls
13)
git status
14)
git add DSA4.cpp
15)
git add -A
16)
git commit -m "initial commit"
17)
git log
18)
git add .
19)
git checkout
20)
git checkout master
21)
git branch
22)
git branch dev
23)
git checkout dev
24)
git checkout -b anuj/multiply
25)
git merge anuj/multiply
26)
touch .ignore
27)
git remote -v
28)
git remote add origin https://github.com
29)
30)
31)
32)
33)
git branch -M master
git push -u origin master
git clone GitHub link
vim readme.md
cat readme.md
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ git --version
git version 2.33.0.windows.2
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ git config --global user.name "Umesh kumari"
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ git config --global user.email "umeshkumari123029@gmail.com"
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ git config --global user.email
umeshkumari123029@gmail.com
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ git config --global --edit
hint: Waiting for your editor to close the file...
/usr/bin/bash: man: command not found
shell returned 127
Press ENTER or type command to continue
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ git status
On branch main
Your branch is up to date with 'origin/main'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: DSA2.cpp
new file: DSA3.cpp
Untracked files:
(use "git add <file>..." to include in what will be committed)
DSA1.exe
DSA10.cpp
DSA10.exe
DSA11.cpp
DSA11.exe
DSA2.exe
DSA3.exe
DSA4.cpp
DSA4.exe
DSA5.cpp
DSA5.exe
DSA6.cpp
DSA6.exe
DSA7.cpp
DSA7.exe
DSA8.cpp
DSA8.exe
DSA9.cpp
DSA9.exe
LinkedList.cpp
LinkedList.exe
tempCodeRunnerFile.cpp
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ cd DSA_PRACTICE_QUESTION
bash: cd: DSA_PRACTICE_QUESTION: No such file or directory
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ git init
Reinitialized existing Git repository in
C:/Users/Umesh/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question/.git/
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ git add
Nothing specified, nothing added.
hint: Maybe you wanted to say 'git add .'?
hint: Turn this message off by running
hint: "git config advice.addEmptyPathspec false"
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ ls
DSA1.cpp DSA11.cpp DSA3.cpp DSA5.cpp DSA7.cpp DSA9.cpp
README.md
DSA1.exe* DSA11.exe* DSA3.exe* DSA5.exe* DSA7.exe*
DSA9.exe*
tempCodeRunnerFile.cpp
DSA10.cpp DSA2.cpp DSA4.cpp DSA6.cpp DSA8.cpp
LinkedList.cpp
DSA10.exe* DSA2.exe* DSA4.exe* DSA6.exe* DSA8.exe*
LinkedList.exe*
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ git add DSA4.cpp
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ git add -A
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ git status
On branch main
Your branch is up to date with 'origin/main'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: DSA1.exe
new file: DSA10.cpp
new file: DSA10.exe
new file: DSA11.cpp
new file: DSA11.exe
new file: DSA2.cpp
new file: DSA2.exe
new file: DSA3.cpp
new file: DSA3.exe
new file: DSA4.cpp
new file: DSA4.exe
new file: DSA5.cpp
new file: DSA5.exe
new file: DSA6.cpp
new file: DSA6.exe
new file:
new file:
new file:
new file:
new file:
new file:
new file:
new file:
new file:
DSA7.cpp
DSA7.exe
DSA8.cpp
DSA8.exe
DSA9.cpp
DSA9.exe
LinkedList.cpp
LinkedList.exe
tempCodeRunnerFile.cpp
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ git commit -m "initial commit"
[main 4283ee9] initial commit
24 files changed, 828 insertions(+)
create mode 100644 DSA1.exe
create mode 100644 DSA10.cpp
create mode 100644 DSA10.exe
create mode 100644 DSA11.cpp
create mode 100644 DSA11.exe
create mode 100644 DSA2.cpp
create mode 100644 DSA2.exe
create mode 100644 DSA3.cpp
create mode 100644 DSA3.exe
create mode 100644 DSA4.cpp
create mode 100644 DSA4.exe
create mode 100644 DSA5.cpp
create mode 100644 DSA5.exe
create mode 100644 DSA6.cpp
create mode 100644 DSA6.exe
create mode 100644 DSA7.cpp
create mode 100644 DSA7.exe
create mode 100644 DSA8.cpp
create mode 100644 DSA8.exe
create mode 100644 DSA9.cpp
create mode 100644 DSA9.exe
create mode 100644 LinkedList.cpp
create mode 100644 LinkedList.exe
create mode 100644 tempCodeRunnerFile.cpp
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ git log
commit 4283ee922cc06af1147b270ee184b6eed0d58d3e (HEAD ->
main)
commit 4283ee922cc06af1147b270ee184b6eed0d58d3e (HEAD ->
main)
Author: Umesh kumari <umeshkumari123029@gmail.com>
Date: Tue May 3 18:39:18 2022 +0530
initial commit
commit 154b27fc0ab7a148e4de1d9d884aee3d61a91780 (origin/main,
origin/HEAD)
Author: Umesh <umeshkumari123029@gmail.com>
Date: Sat Apr 30 10:39:44 2022 +0530
Dsa first file
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ git branch
* main
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ git push
Enumerating objects: 27, done.
Counting objects: 100% (27/27), done.
Delta compression using up to 4 threads
Compressing objects: 100% (26/26), done.
Writing objects: 100% (26/26), 57.75 KiB | 1.31 MiB/s, done.
Total 26 (delta 12), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (12/12), done.
To https://github.com/UmeshKumari-202128/DSA-Questions.git
154b27f..4283ee9 main -> main
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ git add LinkedList.cpp
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ git commit -m "added new method for middle element"
[main b32385c] added new method for middle element
1 file changed, 35 insertions(+), 35 deletions(-)
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$ git push
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 499 bytes | 499.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To https://github.com/UmeshKumari-202128/DSA-Questions.git
4283ee9..b32385c main -> main
Umesh@LAPTOP-IGVL8UGU MINGW64 ~/OneDrive/Desktop/DSAQuestions/DSA_Practice_Question (main)
$
Download