1 git config --global user.name "myy"
2 git config --global user.email "879785057@qq.com"
6 cd d:
7 cd www
8 cd testgit/
9 pwd
10 git init 初始化
13 dir 显示当前目录下的内容
14 git add 测试.txt 建立索引
15 git commit -m "测试.txt" 提交到本地仓库
16 git status
18 git diff 测试.txt
19 git status
20 git diff 测试.txt 查看当前和提交后的差异
22 git log 查看提交日志
23 git add 测试.txt
24 git commit -m "第二次提交"
25 git log
26 git diff 测试.txt
29 git add "测试.txt"
30 git commit -m "第三次提交"
32 git log
38 git reset --hard HEAD^
40 git reset --hard HEAD~2
41 git reset --hard HEAD~1
42 git log
44 git reflog 查看历史提交记录
45 git reset --hard d56b3e2 回退到d56b3e2的版本
46 cat 测试.txt
47 git status
48 git add new2.txt
49 git status
50 git add "测试.txt"
51 git status
53 cat 测试.txt
56 git commit -m "一次性提交两个文件,测试.txt和new2.txt"
57 git checkout --测试.txt
58 git checkout -- 测试.txt
59 cat 测试.txt
60 git checkout -- 测试.txt
61 cat 测试.txt
62 git add 测试.txt
63 cat 测试.txt
64 git checkout -- 测试.txt
65 cat 测试.txt
66 git status
67 git status
68 cat 测试.txt
69 git checkout -- 测试.txt
70 cat 测试.txt
71 git log
72 rm new2.txt
73 dir
74 git status
75 git checkout -- new2.txt
76 dir
77 ssh-keygen -t rsa –C "879785057@qq.com"
78 ssh-keygen t rsa "879785057@qq.com"
79 ssh-keygen -t rsa -C "879785057@qq.com"
80 ssh-keygen -t rsa -C "879785057@qq.com"
84 git clone https://github.com/sky-ma/testgit3
85 git branch dev
86 git branch
87 git checkout dev
88 git branch
89 cat 测试.txt
90 cat 测试.txt
91 git add 测试.txt
92 git commit -m "dev分支上增加内容7777"
93 git checkout master
94 git brance
95 git branch
96 cat 测试.txt
97 git merge dev
98 cat 测试.txt
99 git branch -d dev
100 git branch
101 git checkout -b branch1
102 cat 测试.txt
103 cat 测试.txt
104 git add 测试.txt
105 git commit -m "添加内容8888"
106 cat 测试.txt
107 git checkout master
108 cat 测试.txt
109 cat 测试.txt
110 git merge branch1
111 git status
112 cat 测试.txt
113 git merge branch1
114 git checkout branch1
115 git checkout branch1
116 git checkout branch1
117 git branch
118 git checkout branch1
119 git log
120 git add 测试.txt
121 git commit -m "在master上提交冲突代码"
122 git merge branch1
123 git status
124 cat 测试.txt
125 git log
126 git merge branch1
127 cat 测试.txt
128 git Add 测试.txt
129 git add 测试.txt
130 git commit -m "解决分支冲突"
131 git status
132 git log
133 cat 测试.txt
134 git relog
135 git reflog
136 git branch -d branch1
137 git branch
138 cat 测试.txt
139 git checkout branch1
140 git staus
141 git status
142 git stash list
143 git status
144 git remote
145 git remote -v
146 git push origin master
147 git branch
148 git branch dev
149 git add 测试.txt
150 git commit -m m "提交dev上的数据到github上,新建888"
151 git commit -m "提交dev上的数据到github上,新建888"
152 git reset --hard HEAD~1
153 git branch dev
154 git checkout dev
155 git log
156 cat 测试.txt
157 git add 测试.txt
158 git commit -m "在dev上提交并push"
159 cat 测试.txt
160 git push origin dev
161 git push origin dev
162 cd d:
163 dir
164 cd www
165 dir
166 cd testclone/
167 git clone https://github.com/sky-ma/testgit
168 cd testgit/
169 git branch
170 cat 测试.txt
171 git checkout -b dev origin/dev
172 git branch
173 cat 测试.txt
174 git commit -m "提交"
175 git push origin/dev
176 git push origin\dev
177 git push origin dev
178 cat 测试.txt
179 cd ../..
180 cd testgit/
181 cat 测试.txt
182 git add 测试.txt
183 git commit -m "testgit分支提交"
184 git push origin dev
185 cat 测试.txt
186 cd ../testclone/testgit/
187 cat 测试.txt
188 git pull
189 dir
190 cat 测试.txt
191 git tag
192 git tag mayanyun
193 git tag
194 git push origin mayanyun
195 git tag
196 git checkout mayanyun
197 dir
198 cat 测试.txt
199 cat 测试.txt
200 git checkout dev
201 dir
202 cat new2.txt
203 git add new2.txt
204 git commit -m "提交testclone的首次内容"
205 git push origin dev
206 git push origin dev
207 git tag
208 git tag uat1_20170604_gitclone
209 git tag
210 git push origin uat1_20170604_gitclone
211 git checkout uat1_20170604_gitclone
212 dir
213 cat new2.txt
214 cd ../../
215 ll
216 cd testgit/
217 cat new2.txt
218 git add new2.txt
219 git commit -m m "使用另一个账号提交dev"
220 git commit -m "使用另一个账号提交dev"
221 git push origin dev
222 git pull
223 cat new2.txt
224 dir
225 cd testgit3/
226 ll
227 dir
228 cd ..
229 ll
230 dir
231 cat new2.txt
232 git pull origin dev
233 gitk
234 his
235 history
2 git config --global user.email "879785057@qq.com"
6 cd d:
7 cd www
8 cd testgit/
9 pwd
10 git init 初始化
13 dir 显示当前目录下的内容
14 git add 测试.txt 建立索引
15 git commit -m "测试.txt" 提交到本地仓库
16 git status
18 git diff 测试.txt
19 git status
20 git diff 测试.txt 查看当前和提交后的差异
22 git log 查看提交日志
23 git add 测试.txt
24 git commit -m "第二次提交"
25 git log
26 git diff 测试.txt
29 git add "测试.txt"
30 git commit -m "第三次提交"
32 git log
38 git reset --hard HEAD^
40 git reset --hard HEAD~2
41 git reset --hard HEAD~1
42 git log
44 git reflog 查看历史提交记录
45 git reset --hard d56b3e2 回退到d56b3e2的版本
46 cat 测试.txt
47 git status
48 git add new2.txt
49 git status
50 git add "测试.txt"
51 git status
53 cat 测试.txt
56 git commit -m "一次性提交两个文件,测试.txt和new2.txt"
57 git checkout --测试.txt
58 git checkout -- 测试.txt
59 cat 测试.txt
60 git checkout -- 测试.txt
61 cat 测试.txt
62 git add 测试.txt
63 cat 测试.txt
64 git checkout -- 测试.txt
65 cat 测试.txt
66 git status
67 git status
68 cat 测试.txt
69 git checkout -- 测试.txt
70 cat 测试.txt
71 git log
72 rm new2.txt
73 dir
74 git status
75 git checkout -- new2.txt
76 dir
77 ssh-keygen -t rsa –C "879785057@qq.com"
78 ssh-keygen t rsa "879785057@qq.com"
79 ssh-keygen -t rsa -C "879785057@qq.com"
80 ssh-keygen -t rsa -C "879785057@qq.com"
81 ssh-keygen -t rsa -C "879785057@qq.com"
您可以给远程数据库取一个别名。这样,下次推送的时候就不需要输入长串的远程数据库地址了。在这个教程里,我们的远程数据库命名为“origin”。
$ git remote add <name> <url>
82 git remote add origin https://github.com/sky-ma/testgit.git
使用push命令向数据库推送更改内容。<repository>处输入目标地址,<refspec>处指定推送的分支。
运行以下命令便可向远程数据库‘origin’进行推送。当执行命令时,如果您指定了-u选项,那么下一次推送时就可以省略分支名称了。但是,首次运行指令向空的远程数据库推送时,必须指定远程数据库名称和分支名称。
84 git clone https://github.com/sky-ma/testgit3
85 git branch dev
86 git branch
87 git checkout dev
88 git branch
89 cat 测试.txt
90 cat 测试.txt
91 git add 测试.txt
92 git commit -m "dev分支上增加内容7777"
93 git checkout master
94 git brance
95 git branch
96 cat 测试.txt
97 git merge dev
98 cat 测试.txt
99 git branch -d dev
100 git branch
101 git checkout -b branch1
102 cat 测试.txt
103 cat 测试.txt
104 git add 测试.txt
105 git commit -m "添加内容8888"
106 cat 测试.txt
107 git checkout master
108 cat 测试.txt
109 cat 测试.txt
110 git merge branch1
111 git status
112 cat 测试.txt
113 git merge branch1
114 git checkout branch1
115 git checkout branch1
116 git checkout branch1
117 git branch
118 git checkout branch1
119 git log
120 git add 测试.txt
121 git commit -m "在master上提交冲突代码"
122 git merge branch1
123 git status
124 cat 测试.txt
125 git log
126 git merge branch1
127 cat 测试.txt
128 git Add 测试.txt
129 git add 测试.txt
130 git commit -m "解决分支冲突"
131 git status
132 git log
133 cat 测试.txt
134 git relog
135 git reflog
136 git branch -d branch1
137 git branch
138 cat 测试.txt
139 git checkout branch1
140 git staus
141 git status
142 git stash list
143 git status
144 git remote
145 git remote -v
146 git push origin master
147 git branch
148 git branch dev
149 git add 测试.txt
150 git commit -m m "提交dev上的数据到github上,新建888"
151 git commit -m "提交dev上的数据到github上,新建888"
152 git reset --hard HEAD~1
153 git branch dev
154 git checkout dev
155 git log
156 cat 测试.txt
157 git add 测试.txt
158 git commit -m "在dev上提交并push"
159 cat 测试.txt
160 git push origin dev
161 git push origin dev
162 cd d:
163 dir
164 cd www
165 dir
166 cd testclone/
167 git clone https://github.com/sky-ma/testgit
168 cd testgit/
169 git branch
170 cat 测试.txt
171 git checkout -b dev origin/dev
172 git branch
173 cat 测试.txt
174 git commit -m "提交"
175 git push origin/dev
176 git push origin\dev
177 git push origin dev
178 cat 测试.txt
179 cd ../..
180 cd testgit/
181 cat 测试.txt
182 git add 测试.txt
183 git commit -m "testgit分支提交"
184 git push origin dev
185 cat 测试.txt
186 cd ../testclone/testgit/
187 cat 测试.txt
188 git pull
189 dir
190 cat 测试.txt
191 git tag
192 git tag mayanyun
193 git tag
194 git push origin mayanyun
195 git tag
196 git checkout mayanyun
197 dir
198 cat 测试.txt
199 cat 测试.txt
200 git checkout dev
201 dir
202 cat new2.txt
203 git add new2.txt
204 git commit -m "提交testclone的首次内容"
205 git push origin dev
206 git push origin dev
207 git tag
208 git tag uat1_20170604_gitclone
209 git tag
210 git push origin uat1_20170604_gitclone
211 git checkout uat1_20170604_gitclone
212 dir
213 cat new2.txt
214 cd ../../
215 ll
216 cd testgit/
217 cat new2.txt
218 git add new2.txt
219 git commit -m m "使用另一个账号提交dev"
220 git commit -m "使用另一个账号提交dev"
221 git push origin dev
222 git pull
223 cat new2.txt
224 dir
225 cd testgit3/
226 ll
227 dir
228 cd ..
229 ll
230 dir
231 cat new2.txt
232 git pull origin dev
233 gitk
234 his
235 history