forked from RAHAMSHAIK007/10-03amnew
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2. GIT-01
422 lines (380 loc) · 8.91 KB
/
2. GIT-01
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
Intro, Workflow (add, commit, restore, logs)
yum install git -y : Command to install git
git init : to install empty .git repo
git status : To check the status of a file
Red : Untracked
Green : Tracked
git add java1 : to track the file
git commit -m "commit-1" java1 : to commit the file
git log : to check commit history
git log --oneline : to see commits on sinlge line
git log -2 : to show last 2 commits
git log -2 --oneline : to show last 2 commits on oneline
create a file -- > add -- > commit
TO CONFIGURE USER & EMAIL:
git config user.name "raham"
git config user.email "raham@gmail"
Note: The old commits will not change
GIT IGNORE: to ignore some specific files
it will not track and commits your files
but it will keep them on your folder
NOTE: .gitignore
(. is mandatory)
vim .gitignore
js*
git status
RESTORE: To move back from tacking to untracking
git restore --staged raham
HISTORY:
1 mkdir swiggy
2 cd swiggy/
3 ll
4 ls -al
5 yum install git -y
6 git init
7 pwd
8 ll -a
9 touch java1
10 git status
11 git add java1
12 git status
13 git commit -m "commit-1" java1
14 touch java2
15 git status
16 git add java2
17 git status
18 git commit -m "commit-2" java2
19 git log
20 git log --oneline
21 git config user.name "raham"
22 git config user.email "raham@gmail"
23 git log
24 touch java3
25 git add java3
26 git commit -m "commit-3" java3
27 git log
28 ll
29 touch python{1..5}
30 touch js{1..5}
31 ll
32 git status
33 vim .gitignore
34 git status
35 ll
36 vim .gitignore
37 git status
38 ll
39 vim .gitignore
40 git status
41 git add *
42 git status
43 git commit -m "commit-4" p*
44 ll
45 git log
46 git log -2
47 git log -2 --oneline
48 touch raham
49 git status
50 git add raham
51 git status
52 git restore --staged raham
53 git status
==========================================================================================================
DAY-02: (BRANCHES, MERGE, REBASE, GITHUB, PUSHING ACTIVITES, REVERT)
Default branch in git Master
git branch movies : to create branch
git branch : to list the branches
git checkout movies : to switch the branches
git checkout -b recharge : to create and swith parallely
git branch -D train : to delete branch forecfully
git branch -m recharge raham : to rename a branch
MERGE: To combine the branches
master -- > master + movies = all files from movies branch will come to master
CREATE ROP ON GITHUB
git remote add origin https://github.com/prashanthravikanti2023/swiggy.git
git push origin master
settings -- > developer settings -- > personal access token -- > classic
generate token -- > create --- > select 6 options -- > generate -- >
Note: Token ins visible only for once
REVERET: To undo chnages in branch level
RESTORE: to move file form tracked to untracked
HISTORY:
1 mkdir swiggy
2 cd swiggy/
3 yum install git -y
4 git --version
5 git -v
6 git init
7 ll -a
8 touch file1
9 git add file1
10 git config user.name "raham"
11 git config user.email "[email protected]"
12 git commit -m "abc commits" file1
13 git branch
14 git branch movies
15 git branch
16 git checkout movies
17 git branch
18 touch movies{1..5}
19 git status
20 git add *
21 git status
22 git commit -m "dev-1 commits" *
23 ll
24 git branch
25 git branch train
26 git branch
27 git checkout train
28 ll
29 git status
30 touch train{1..5}
31 git status
32 git add *
33 git commit -m "dev-2 commits" *
34 git status
35 git branch
36 git checkout -b recharge
37 git branch
38 ll
39 touch recharge{1..5}
40 git add *
41 git status
42 git commit -m "dev-3 commits" *
43 git status
44 ll
45 git checkout movies
46 ll
47 git branch
48 git checkout -b dth
49 git branch
50 ll
51 touch dth{1..5}
52 git add *
53 git commit -m "dev-4 commits" *
54 ll
55 git checkout master
56 git branch
57 ll
58 git merge movies
59 ll
60 git merge train
61 ll
62 git rebase recharge
63 ll
64 git rebase dth
65 ll
66 git remote add origin https://github.com/prashanthravikanti2023/swiggy.git
67 ls -al
68 git branch
69 git push origin master
70 git branch
71 git push origin movies
72 git push origin train
73 git branch
74 git branch -d train
75 git branch -D train
76 git branch
77 git pull origin train
78 ll
79 git branch
80 git branch -m recharge raham
81 git branch
82 git branch -m raham abcd
83 git branch
84 git checkout abcd
85 ll
86 git merge dth
87 ll
88 git revert dth
89 ll
90 touch file2
91 git add
92 git status
93 git add file2
94 git status
95 git restore --staged file2
96 git status
======================================================================
DAY-03: (BRANCHES, GITHUB MERGE, PULL, PUSH, FETCH, STATSH, CHERRY-PICK, RESTORE, REVERET RENAMEING)
2 cd swiggy/
3 git branch
4 git branch movies
5 git checkout movies
6 ll
7 touch movies{1..5}
8 git add *
9 git commit -m "dev-1 commits" *
10 ll
11 git checkout -b train
12 touch train{1..5}
13 git add *
14 git commit -m "dev-2 commits" *
15 ll
16 git checkout -b recharge
17 ll
18 touch recharge{1..5}
19 git add *
20 git commit -m "dev-3 commits" *
21 git checkout -b dth
22 touch dth{1..5}
23 git add *
24 git commit -m "dev-4 commits" *
25 ll
26 git checkout master
27 git branch
28 ll
29 ls -al
30 git remote add origin https://github.com/RAHAMSHAIK007/swiggy-project.git
31 git push origin master
32 git branch
33 git push origin movies
34 git push origin train
35 git push origin recharge
36 git push origin dth
37 git log
38 git branch
39 ll
40 git pull origin master
41 ll
42 git pull origin master
43 ll
44 cat dth1
45 git pull origin master
46 cat dth1
47 git fetch origin master:master
48 git fetch
49 cat dth1
50 ll
51 cd
52 mkdir abcd
53 cd abcd/
54 ll
55 touch file1
56 git add file1
57 ls -al
58 git init
59 git add file1
60 ll
61 git status
62 git commit -m "one" file1
63 git branch
64 cd
65 ll
66 cd abcd/
67 ll
68 touch file2
69 git add file2
70 git status
71 ll
72 git stash
73 ll
74 git stash list
75 touch file3
76 git add file3
77 ll
78 git stash
79 ll
80 git stash list
81 ll
82 git stash pop
83 ll
84 git stash clear
85 git stash list
86 ll
87 cd ..
88 ll
89 cd swiggy/
90 git log
91 cd
92 mkdir raham
93 cd raham/
94 ll
95 git init
96 git branch -m branch-1
97 touch java{1..5}
98 git add *
99 git commit -m "java-commits" *
100 git branch
101 git log
102 git checkout -b branch-2
103 touch python{1..5}
104 git add *
105 git commit -m "python-commits" *
106 touch php{1..5}
107 git add *
108 git commit -m "php-commits" *
109 git branch
110 git log
111 git checkout branch-1
112 git log
113 ll
114 git cherry-pick a9e41fd94453f33db32fb3782360407cee08e759
115 ll
=============================================================
DAY-04:
https://the.earth.li/~sgtatham/putty/latest/w64/putty-64bit-0.78-installer.msi
DAY-04:
1 mkdir raham
2 cd raham/
3 yum install git -y
4 git init
5 touch file1
6 vim file1
7 git add file1
8 git commit -m "dev-1 commits-1" file1
9 ll
10 git branch
11 git branch -m master branch-1
12 git branch
13 git checkout -b branch-2
14 ll
15 vim file1
16 git add file1
17 git commit -m "dev-2 commits-1" file1
18 git checkout branch-1
19 ll
20 vim file1
21 git add file1
22 git commit -m "dev-1 commit-2" file1
23 git branch
24 cat file1
25 git checkout branch-2
26 cat file1
27 git checkout branch-2
28 git checkout branch-1
29 cat file1
30 git merge branch-2
31 git diff file1
32 vim file1
33 git add file1
34 git status
35 git commit -m "new" file1
36 git commit -m "new"
37 cat file1
38 cd
39 ll
40 rm -rf raham/
41 ll
42 git clone https://github.com/devops0014/pic.git
43 ll
44 cd pic/
45 ll
46 cat nani nani
47 cat nani
48 dc
49 cd
50 ll
51 git clone https://github.com/devops0014/nodejs-docker.git
52 ll
53 cd nodejs-docker
54 ll
55 cd
56 rm -rf *
57 vim inde.hrtml
58 git clone https://github.com/devops0014/devisyam-repo.git
59 ll
60 history
61 git log --oneline
62 git show 38ba354
63 git diff 38ba354