-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGit_Practice_Cmd_file.txt
More file actions
550 lines (405 loc) · 18.6 KB
/
Git_Practice_Cmd_file.txt
File metadata and controls
550 lines (405 loc) · 18.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
Microsoft Windows [Version 10.0.19045.6466]
(c) Microsoft Corporation. All rights reserved.
C:\Users\SUBHASH>cd C:\Users\SUBHASH\Documents\Github
C:\Users\SUBHASH\Documents\Github>git clone https://github.com/subhashtesting1994-ops/git_learning.git
Cloning into 'git_learning'...
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 7 (delta 1), reused 0 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (7/7), 5.79 KiB | 1.45 MiB/s, done.
Resolving deltas: 100% (1/1), done.
C:\Users\SUBHASH\Documents\Github> git status
fatal: not a git repository (or any of the parent directories): .git
C:\Users\SUBHASH\Documents\Github>cd C:\Users\SUBHASH\Documents\Github\
C:\Users\SUBHASH\Documents\Github>cd C:\Users\SUBHASH\Documents\Github\git_learning
C:\Users\SUBHASH\Documents\Github\git_learning> git status
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: README.md
no changes added to commit (use "git add" and/or "git commit -a")
C:\Users\SUBHASH\Documents\Github\git_learning>git add README.md
C:\Users\SUBHASH\Documents\Github\git_learning> 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)
modified: README.md
C:\Users\SUBHASH\Documents\Github\git_learning> git restore --staged READMe.md
error: pathspec 'READMe.md' did not match any file(s) known to git
C:\Users\SUBHASH\Documents\Github\git_learning> git restore --staged README.md
C:\Users\SUBHASH\Documents\Github\git_learning> git status
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: README.md
no changes added to commit (use "git add" and/or "git commit -a")
C:\Users\SUBHASH\Documents\Github\git_learning>git add README.md
C:\Users\SUBHASH\Documents\Github\git_learning> git reset HEAD readme.md
C:\Users\SUBHASH\Documents\Github\git_learning> 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)
modified: README.md
C:\Users\SUBHASH\Documents\Github\git_learning>git diff
C:\Users\SUBHASH\Documents\Github\git_learning> git reset HEAD readme.md
C:\Users\SUBHASH\Documents\Github\git_learning>git diff
C:\Users\SUBHASH\Documents\Github\git_learning> git restore --staged README.md
C:\Users\SUBHASH\Documents\Github\git_learning> git status
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: README.md
no changes added to commit (use "git add" and/or "git commit -a")
C:\Users\SUBHASH\Documents\Github\git_learning>git diff
diff --git a/README.md b/README.md
index 2f6093a..e8fdfcd 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,5 @@
# git_learning
Git and Github | Complete हिंदी में (With Examples) courses | youtube | hands-on
https://www.youtube.com/watch?v=zGq7T9gZH2k
+
+This repo will be used to learn git commands.
C:\Users\SUBHASH\Documents\Github\git_learning>git diff
diff --git a/README.md b/README.md
index 2f6093a..e8fdfcd 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,5 @@
# git_learning
Git and Github | Complete हिंदी में (With Examples) courses | youtube | hands-on
https://www.youtube.com/watch?v=zGq7T9gZH2k
+
+This repo will be used to learn git commands.
C:\Users\SUBHASH\Documents\Github\git_learning>git add README.md
C:\Users\SUBHASH\Documents\Github\git_learning> 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)
modified: README.md
C:\Users\SUBHASH\Documents\Github\git_learning>git rm README.md
error: the following file has changes staged in the index:
README.md
(use --cached to keep the file, or -f to force removal)
C:\Users\SUBHASH\Documents\Github\git_learning> git restore --staged README.md
C:\Users\SUBHASH\Documents\Github\git_learning>git rm README.md
error: the following file has local modifications:
README.md
(use --cached to keep the file, or -f to force removal)
C:\Users\SUBHASH\Documents\Github\git_learning>git add README.md
C:\Users\SUBHASH\Documents\Github\git_learning> 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)
modified: README.md
C:\Users\SUBHASH\Documents\Github\git_learning>git commit
Author identity unknown
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'SUBHASH@DESKTOP-NQ3MPFH.(none)')
C:\Users\SUBHASH\Documents\Github\git_learning>git diff
C:\Users\SUBHASH\Documents\Github\git_learning>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)
modified: README.md
C:\Users\SUBHASH\Documents\Github\git_learning>git commit
Author identity unknown
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'SUBHASH@DESKTOP-NQ3MPFH.(none)')
C:\Users\SUBHASH\Documents\Github\git_learning>git config --global user.email subhashtesting1994@gmail.com
C:\Users\SUBHASH\Documents\Github\git_learning>git config --global user.name subhashtesting1994-ops
C:\Users\SUBHASH\Documents\Github\git_learning>git commit
[main e46ba8f] Included additiona description about the repo.
1 file changed, 2 insertions(+)
C:\Users\SUBHASH\Documents\Github\git_learning>git status
On branch main
Your branch is ahead of 'origin/main' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
C:\Users\SUBHASH\Documents\Github\git_learning>git push
info: please complete authentication in your browser...
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), 378 bytes | 189.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/subhashtesting1994-ops/git_learning.git
d7137d4..e46ba8f main -> main
C:\Users\SUBHASH\Documents\Github\git_learning>git log
commit e46ba8fdc32c4d47d8c66062bb4f3ce3c7336953 (HEAD -> main, origin/main, origin/HEAD)
Author: subhashtesting1994-ops <subhashtesting1994@gmail.com>
Date: Sat Mar 7 18:32:00 2026 +0530
Included additiona description about the repo.
commit d7137d4cf7d17227b63bfb1bc34fb425cd69f92c
Author: subhashtesting1994-ops <subhashtesting1994@gmail.com>
Date: Sat Mar 7 17:02:33 2026 +0530
Add YouTube link to README
commit 8761fde69b660c6a2ed83bfc5a2250a608f13f71
Author: subhashtesting1994-ops <subhashtesting1994@gmail.com>
Date: Sat Mar 7 17:02:01 2026 +0530
Initial commit
C:\Users\SUBHASH\Documents\Github\git_learning> git checkout -b new_git_learning
Switched to a new branch 'new_git_learning'
C:\Users\SUBHASH\Documents\Github\git_learning>touch pop
'touch' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\SUBHASH\Documents\Github\git_learning>type nul > pop
C:\Users\SUBHASH\Documents\Github\git_learning>git status
On branch new_git_learning
Untracked files:
(use "git add <file>..." to include in what will be committed)
pop
nothing added to commit but untracked files present (use "git add" to track)
C:\Users\SUBHASH\Documents\Github\git_learning>git add pop
C:\Users\SUBHASH\Documents\Github\git_learning>git status
On branch new_git_learning
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: pop
C:\Users\SUBHASH\Documents\Github\git_learning>git commit -m "added pop file to the branch"
[new_git_learning 75f2a72] added pop file to the branch
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 pop
C:\Users\SUBHASH\Documents\Github\git_learning>git log
commit 75f2a72583d0ade1fde52d150f2d8fe48006adb8 (HEAD -> new_git_learning)
Author: subhashtesting1994-ops <subhashtesting1994@gmail.com>
Date: Sat Mar 7 19:38:44 2026 +0530
added pop file to the branch
commit e46ba8fdc32c4d47d8c66062bb4f3ce3c7336953 (origin/main, origin/HEAD, main)
Author: subhashtesting1994-ops <subhashtesting1994@gmail.com>
Date: Sat Mar 7 18:32:00 2026 +0530
Included additiona description about the repo.
commit d7137d4cf7d17227b63bfb1bc34fb425cd69f92c
Author: subhashtesting1994-ops <subhashtesting1994@gmail.com>
Date: Sat Mar 7 17:02:33 2026 +0530
Add YouTube link to README
commit 8761fde69b660c6a2ed83bfc5a2250a608f13f71
Author: subhashtesting1994-ops <subhashtesting1994@gmail.com>
Date: Sat Mar 7 17:02:01 2026 +0530
Initial commit
C:\Users\SUBHASH\Documents\Github\git_learning> git checkout main
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
C:\Users\SUBHASH\Documents\Github\git_learning>ls
'ls' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\SUBHASH\Documents\Github\git_learning>dir
Volume in drive C has no label.
Volume Serial Number is 6A3E-D4CE
Directory of C:\Users\SUBHASH\Documents\Github\git_learning
03/07/2026 07:41 PM <DIR> .
03/07/2026 07:41 PM <DIR> ..
03/07/2026 05:14 PM 11,558 LICENSE
03/07/2026 06:15 PM 208 README.md
2 File(s) 11,766 bytes
2 Dir(s) 15,457,284,096 bytes free
C:\Users\SUBHASH\Documents\Github\git_learning> git checkout new_git_learning
Switched to branch 'new_git_learning'
C:\Users\SUBHASH\Documents\Github\git_learning>dir
Volume in drive C has no label.
Volume Serial Number is 6A3E-D4CE
Directory of C:\Users\SUBHASH\Documents\Github\git_learning
03/07/2026 07:42 PM <DIR> .
03/07/2026 07:42 PM <DIR> ..
03/07/2026 05:14 PM 11,558 LICENSE
03/07/2026 07:42 PM 0 pop
03/07/2026 06:15 PM 208 README.md
3 File(s) 11,766 bytes
2 Dir(s) 15,457,357,824 bytes free
C:\Users\SUBHASH\Documents\Github\git_learning>git branch
main
* new_git_learning
C:\Users\SUBHASH\Documents\Github\git_learning> git checkout main
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
C:\Users\SUBHASH\Documents\Github\git_learning>git branch
* main
new_git_learning
C:\Users\SUBHASH\Documents\Github\git_learning>git fetch
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0 (from 0)
Unpacking objects: 100% (3/3), 1.03 KiB | 11.00 KiB/s, done.
From https://github.com/subhashtesting1994-ops/git_learning
e46ba8f..8bd9b1f main -> origin/main
C:\Users\SUBHASH\Documents\Github\git_learning>git status
On branch main
Your branch is behind 'origin/main' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
nothing to commit, working tree clean
C:\Users\SUBHASH\Documents\Github\git_learning>dir
Volume in drive C has no label.
Volume Serial Number is 6A3E-D4CE
Directory of C:\Users\SUBHASH\Documents\Github\git_learning
03/07/2026 07:43 PM <DIR> .
03/07/2026 07:43 PM <DIR> ..
03/07/2026 05:14 PM 11,558 LICENSE
03/07/2026 06:15 PM 208 README.md
2 File(s) 11,766 bytes
2 Dir(s) 14,389,592,064 bytes free
C:\Users\SUBHASH\Documents\Github\git_learning>git merge orgin/main
merge: orgin/main - not something we can merge
C:\Users\SUBHASH\Documents\Github\git_learning>git merge origin/main
Updating e46ba8f..8bd9b1f
Fast-forward
README.md | 3 +++
1 file changed, 3 insertions(+)
C:\Users\SUBHASH\Documents\Github\git_learning>dir
Volume in drive C has no label.
Volume Serial Number is 6A3E-D4CE
Directory of C:\Users\SUBHASH\Documents\Github\git_learning
03/07/2026 08:22 PM <DIR> .
03/07/2026 08:22 PM <DIR> ..
03/07/2026 05:14 PM 11,558 LICENSE
03/07/2026 08:22 PM 277 README.md
2 File(s) 11,835 bytes
2 Dir(s) 14,389,284,864 bytes free
C:\Users\SUBHASH\Documents\Github\git_learning>git status
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: README.md
no changes added to commit (use "git add" and/or "git commit -a")
C:\Users\SUBHASH\Documents\Github\git_learning>git commit -a -m "local commit for resolve conflict"
[main a82d8ef] local commit for resolve conflict
1 file changed, 2 insertions(+)
C:\Users\SUBHASH\Documents\Github\git_learning>git status
On branch main
Your branch is ahead of 'origin/main' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
C:\Users\SUBHASH\Documents\Github\git_learning>git push
To https://github.com/subhashtesting1994-ops/git_learning.git
! [rejected] main -> main (fetch first)
error: failed to push some refs to 'https://github.com/subhashtesting1994-ops/git_learning.git'
hint: Updates were rejected because the remote contains work that you do not
hint: have locally. This is usually caused by another repository pushing to
hint: the same ref. If you want to integrate the remote changes, use
hint: 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
C:\Users\SUBHASH\Documents\Github\git_learning>git pull
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0 (from 0)
Unpacking objects: 100% (3/3), 1003 bytes | 11.00 KiB/s, done.
From https://github.com/subhashtesting1994-ops/git_learning
8bd9b1f..307bba7 main -> origin/main
Auto-merging README.md
CONFLICT (content): Merge conflict in README.md
Automatic merge failed; fix conflicts and then commit the result.
C:\Users\SUBHASH\Documents\Github\git_learning>git status
On branch main
Your branch and 'origin/main' have diverged,
and have 1 and 1 different commits each, respectively.
(use "git pull" if you want to integrate the remote branch with yours)
You have unmerged paths.
(fix conflicts and run "git commit")
(use "git merge --abort" to abort the merge)
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: README.md
no changes added to commit (use "git add" and/or "git commit -a")
C:\Users\SUBHASH\Documents\Github\git_learning>vim README.md
'vim' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\SUBHASH\Documents\Github\git_learning>git status
On branch main
Your branch and 'origin/main' have diverged,
and have 1 and 1 different commits each, respectively.
(use "git pull" if you want to integrate the remote branch with yours)
You have unmerged paths.
(fix conflicts and run "git commit")
(use "git merge --abort" to abort the merge)
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: README.md
no changes added to commit (use "git add" and/or "git commit -a")
C:\Users\SUBHASH\Documents\Github\git_learning>git add README.md
C:\Users\SUBHASH\Documents\Github\git_learning>git commit
[main d07e765] Merge branch 'main' of https://github.com/subhashtesting1994-ops/git_learning
C:\Users\SUBHASH\Documents\Github\git_learning>git status
On branch main
Your branch is ahead of 'origin/main' by 2 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
C:\Users\SUBHASH\Documents\Github\git_learning>gitk
C:\Users\SUBHASH\Documents\Github\git_learning>git status
On branch main
Your branch is ahead of 'origin/main' by 2 commits.
(use "git push" to publish your local commits)
Untracked files:
(use "git add <file>..." to include in what will be committed)
Final_master.JPG
Local_change.JPG
Origin_change.JPG
gitk.JPG
nothing added to commit but untracked files present (use "git add" to track)
C:\Users\SUBHASH\Documents\Github\git_learning>git commit -a -m "included gitk images"
On branch main
Your branch is ahead of 'origin/main' by 2 commits.
(use "git push" to publish your local commits)
Untracked files:
(use "git add <file>..." to include in what will be committed)
Final_master.JPG
Local_change.JPG
Origin_change.JPG
gitk.JPG
nothing added to commit but untracked files present (use "git add" to track)
C:\Users\SUBHASH\Documents\Github\git_learning>git add .
C:\Users\SUBHASH\Documents\Github\git_learning>git status
On branch main
Your branch is ahead of 'origin/main' by 2 commits.
(use "git push" to publish your local commits)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: Final_master.JPG
new file: Local_change.JPG
new file: Origin_change.JPG
new file: gitk.JPG
C:\Users\SUBHASH\Documents\Github\git_learning>git commit -a -m "included gitk images"
[main 5b08daa] included gitk images
4 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 Final_master.JPG
create mode 100644 Local_change.JPG
create mode 100644 Origin_change.JPG
create mode 100644 gitk.JPG
C:\Users\SUBHASH\Documents\Github\git_learning>git push
Enumerating objects: 16, done.
Counting objects: 100% (16/16), done.
Delta compression using up to 4 threads
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 437.89 KiB | 10.95 MiB/s, done.
Total 12 (delta 2), reused 0 (delta 0), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (2/2), completed with 1 local object.
To https://github.com/subhashtesting1994-ops/git_learning.git
307bba7..5b08daa main -> main
C:\Users\SUBHASH\Documents\Github\git_learning>