-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathgit.sh
236 lines (221 loc) · 4.41 KB
/
git.sh
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
ssh demo@13.126.117.57
password: demo
mkdir israrul
cd israrul
mkdir project1
ls
cd project1/
ls
git init
ls -la
echo "This is my first class to git" > file1.txt
ls
cat file1.txt
git status
git add file1.txt
git status
git commit -m "created file1.txt"
cd israrul/
ls
mkdir project2
cd project2/
git init
echo "This is file1" > file1.txt
git status
git add file1.txt
git status
git commit -m "created file1.txt"
git status
top
cd ..
ls
cd project1/
ls
git remote add origin https://github.com/4iglance/project1.git
git push -u origin master
clear
echo "This is file2" > file2.txt
git status
git add file2.txt
git status
git commit -m "created file2.txt"
git push origin master
git branch featureA
git branch -a
git branch -D featureA
git branch -a
ls
git checkout -b featureA
ls
git status
git checkout master
git branch -a
git checkout featureA
git branch -a
git branch featureA
git branch -a
git branch -D featureA
git branch -a
ls
git checkout -b featureA
ls
git status
git checkout master
git branch -a
git checkout featureA
git branch -a
history
git branch -a
git log
cd israrul/
clear
ls
cd project1
ls
git log
echo "This is file 3" > file3.txt
ls
git status
git stash -u
git checkout master
ls
echo "This is file4" > file4.txt
git status
git add file4.txt
git commit -m "created file4.txt"
git checkout featureA
git stash pop
git add file3.txt
git commit -m "created file3.txt"
git log
git revert f61f608456b2e967cbce5822e1dc5603e3145251(commit id)
ctrl + x (To save the changes)
ctrl + o (To exit from nano editor)
git log
git branch -a
ls
cat file3.txt
echo "This is third line in file3" >> file3.txt
cat file3.txt
git add file3.txt
git commit -m "updated file3.txt"
git log
git diff 1e4b3aed8a2906cd849e08372ffa47eae3d8972e e2f32fb6396efcbcc0c
git diff e2f32fb6396efcbcc0c 1e4b3aed8a2906cd849e08372ffa47eae3d8972e
cd project1/
clear
pwd
ls
git branch -a
git log
git checkout -b featureA
ls
git status
echo "This is 3rd file in featureA branch" > file3.txt
ls
git status
git add file3.txt
git status
git commit -m "adding file3.txt"
git config --global user.email "@gmail.com"
git config --global user.name "hisrarul"
git commit -m "adding file3.txt"
git log
git checkout master
ls
git merge featureA
ls
cat file3.txt
mkdir project2
cd project
cd project2
clear
git status
git init
git status
echo "file 1 created in master" > file1.txt
echo "file 2 created in master" > file2.txt
echo "file 3 created in master" > file3.txt
git status
git add .
git commit -m "added 3 files in master"
git log
echo "file 4 created in master" > file4.txt
git status
git add file4.txt
git commit -m "created file4 in master"
git log
echo "file 5 created in master" > file5.txt
git status
git add .
git commit -m "added in file 5 in master"
git log
git remote add origin https://github.com/4iglance/project2.git
git remote -v
git push origin master
git checkout -b test
ls
echo "file 6 created in master" > file6.txt
git status
git add .
git commit -m "adding a new file 6 in test branch"
git checkout master
echo "file 7 created in master" > file7.txt
git add .
git commit -m "adding file 7 in master"
echo "file 8 created in master" > file8.txt
git add .
git commit -m "adding file 8 in master"
git log
git push origin master
git branch -a
git checkout test
git log --graph --pretty=oneline
git log --graph
clear
git branch -a
git log --graph
ls
git status
git checkout master
ls
git log --graph
git checkout test
git log --graph --pretty=oneline
git rebase master
git log --graph --pretty=oneline
git pull origin master
ls
cat file6.txt
git merge test
vi file6.txt
cat file6.txt
git merge test
git status
git add file6.txt
git merge test
git commit -m "merge conflict"
git merge test
echo "We are going to explore merge conflict from github.com byy creating a file in master branch" >> file9.txt
echo "Let's do this" >> file9.txt
cat file9.txt
git checkout test
ls
echo "We are going to explore merge conflict from github.com byy creating a file in master branch" >> file9.txt
echo "She is beautiful" >> file9.txt
echo "She is beautiful with her wonderful thoughts" >> file9.txt
git add .
git commit -m "added file9.txt"
git push origin test
git checkout master
git status
git push origin master
ls
git status
echo "We are going to explore merge conflict from github.com byy creating a file in master branch" >> file9.txt
echo "Let's do this" >> file9.txt
ls
git status
git add file9.txt
git commit -m "created file9.txt"
git push origin master