-
Notifications
You must be signed in to change notification settings - Fork 59
/
GIT
258 lines (245 loc) · 5.59 KB
/
GIT
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
ls -l --> WD
git ls-files --> Whether the files are being tracked or not - File location (SA/LR)
git status --> To confirm whether the files are in SA or LR
Before you "git push" changes to a branch, first perform "git pull"
Before you "git merge", "git rebase" first
Commands:
root@ip-172-31-43-101:~/devops-june-2023# history
1 apt update -y
2 clear
3 git version
4 git clone https://github.com/raushan8586/devops-repo-sample.git
5 ls -l
6 cd devops-repo-sample/
7 ls -l
8 clear
9 ls -l
10 cd ..
11 ls -l
12 mkdir devops-june-2023
13 ls -l
14 cd devops-repo-sample/
15 ls -la
16 cd ../devops-june-2023/
17 ls -la
18 git init
19 git branch
20 touch sample1.txt
21 vi sample1.txt
22 cat sample1.txt
23 ls -l
24 ls
25 pwd
26 ls -l
27 ls -la
28 git status
29 git add sample1.txt
30 git status
31 ls -l
32 git ls-files
33 git status
34 git commit -m "1st commit"
35 ls -l
36 git ls-files
37 git status
38 clear
39 ls -l
40 git status
41 git branch
42 git log
43 git show 0b66b38f0c838d3c7313f0b81db2deeaf86187eb
44 git log --oneline
45 touch sample2.txt
46 vi sample2.txt
47 git add .
48 ls -l
49 git ls-files
50 git status
51 git commit -m "2nd commit"
52 git log --oneline
53 ls -l
54 git ls-files
55 git status
56 git log --oneline
57 git show f891c0b
58 git remote -v
59 git remote add origin https://github.com/raushan8586/devops-june-repo.git
60 git remote -v
61 git push origin master
62 history
git config --list
34 git config --global user.name "raushan"
35 git config --list
36 git config --global user.email "[email protected]"
37 git config --list
38 vi sample4.txt
git diff sample3.txt
56 git add sample3.txt
57 git diff sample3.txt
58 git diff --staged sample3.txt
git branch b1 master
68 git branch
69 git checkout b1
70 git branch
71 git log --oneline
72 git branch b2 master
73 git checkout b2
74 git log --oneline
75 history
vi sample4.txt
80 git diff sample4.txt
81 git status
82 git restore sample4.txt
83 git status
84 vi sample4.txt
85 clear
86 git branch
87 git log --oneline
88 git checkout b1
89 git branch
90 git log --oneline
91 ls -l
92 vi b1_file1
93 git status
94 git add .
95 git commit -m "b1_1st_commit"
96 git log --oneline
97 git push origin b1
98 git branch c1 b1
99 git branch
100 git push origin c1
101 git checkout c1
102 git status
103 git log --oneline
104 git branch
105 git checkout b1
106 git checkout master
107 git merge b1 master
108 git log --oneline
109 git checkout b2
110 git branch
111 git log --oneline
112 git rebase master
113 git log --oneline
114 git log --graph --pretty=oneline
115 git checkout master
116 git branch
117 ls -l
118 vi sample5.txt
119 git add .
120* git commit -m "8th comm
121 git log --oneline
122 git checkout b2
123 vi b2_demo1
124 git add .
125 git commit -m "b2_1st_commit"
126 git log --oneline
127 git log --graph --pretty=oneline
128 git rebase master
129 git log --graph --pretty=oneline
130 git checkout master
131 git branch
132 vi test.txt
133 git add .
134 git commit -m "test-file-updated-master"
135 git checkout b2
136 vi test.txt
137 git add .
138 got commit -m "test-file-updated-b2"
139 git commit -m "test-file-updated-b2"
140 git log --oneline
141 git checkout master
142 git merge b2 master
143 vi test.txt
144 git status
145 git add .
146 git status
147 git commit -m "test-file-updated-master-b2"
148 git status
149 git log --graph --pretty=oneline
cd devops-june-repo/
154 ls -l
155 vi ReadMe1st
156 vi app.log
157 git status
158 touch .gitignore
159 vi .gitignore
160 git status
161 git add .
162 git commit -m "gitIgnore added"
163 git status
164 vi .gitignore
165 cat .gitignore
166 git log --oneline
167 ls -l
168 git branch
169 vi sample6.txt
170 git add .
171 git commit -m "9th commit"
172 git log --oneline
173 git show c0da8f3
174 ls -l
175 clear
176 git log --oneline
177 git revert c0da8f3
178 git log --oneline
179 ls -l
180 git show 6e5b16b
181 ls -l
182 rm sample5.txt
183 ls -l
184 git ls-files
185 git status
186 git restore sample5.txt
187 ls -l
188 git status
189 git rm sample5.txt
190 ls -l
191 git ls-files
192 git status
193 git restore --staged sample5.txt
194 ls -l
195 git ls-files
196 git status
197 git restore sample5.txt
198 git status
199 ls -l
200 git ls-files
201 history
202 clear
203 git log --oneline
204 git reset --hard aac2a61
205 git log --oneline
206 git status
207 history
210 vi sample1.txt
211 vi sample2.txt
212 vi sample1.txt
213 vi sample2.txt
214 git status
215 git stash list
216 git stash
217 git status
218 git stash list
219 git show stash@{0}
220 ls -l
221 history
225 git stash list
226 ls -l
227 git show stash@{0}
228 git stash pop stash@{0}
229 git status
230 git stash list
231 git stash -p
232 git status
233 git stash list
234 git show stash@{0}
235 git stash clear
236 git stash list
237 git status list
238 git status
239 vi sample2.txt
240 git add .
241 git commit -m "10 commit"
242 git log --oneline
243 history