@@ -151,17 +151,17 @@ git push origin/mybranch -u
151
151
152
152
## 删除本地分支
153
153
``` sh
154
- git branch -d < local_branchname >
154
+ git branch -d < local-branchname >
155
155
```
156
156
157
157
## 删除远程分支
158
158
``` sh
159
- git push origin --delete < remote_branchname >
159
+ git push origin --delete < remote-branchname >
160
160
```
161
161
162
162
或者
163
163
``` sh
164
- git push origin :< remote_branchname >
164
+ git push origin :< remote-branchname >
165
165
```
166
166
167
167
## 查看标签(tag)
@@ -208,7 +208,7 @@ git push origin :refs/tags/<tag-name>
208
208
209
209
## 放弃工作区的修改
210
210
``` sh
211
- git checkout < file_name >
211
+ git checkout < file-name >
212
212
```
213
213
214
214
放弃所有修改:
@@ -240,12 +240,11 @@ git log
240
240
## 查看某段代码是谁写的
241
241
blame的意思为‘责怪’,你懂的。
242
242
``` sh
243
- git blame < file_name >
243
+ git blame < file-name >
244
244
```
245
245
246
246
## 显示本地执行过git命令
247
247
就像shell的history一样
248
-
249
248
```
250
249
git reflog
251
250
```
@@ -333,7 +332,7 @@ git stash clear
333
332
334
333
## 从stash中拿出某个文件的修改
335
334
``` sh
336
- git checkout < stash@{n}> -- < file_path >
335
+ git checkout < stash@{n}> -- < file-path >
337
336
```
338
337
339
338
## 展示所有tracked的文件
@@ -357,14 +356,14 @@ git ls-files --others -i --exclude-standard
357
356
2 . 不会影响tracked的文件的改动,只会删除untracked的文件
358
357
359
358
``` sh
360
- git clean < file_name > -f
359
+ git clean < file-name > -f
361
360
```
362
361
363
362
## 强制删除untracked的目录
364
363
可以用来删除新建的目录,** 注意** :这个命令也可以用来删除untracked的文件。详情见上一条
365
364
366
365
``` sh
367
- git clean < directory_name > -df
366
+ git clean < directory-name > -df
368
367
```
369
368
370
369
## 重命名分支
@@ -436,12 +435,12 @@ git config --global --unset <entry-name>
436
435
## 新建并切换到新分支上,同时这个分支没有任何commit
437
436
相当于保存修改,但是重写commit历史
438
437
``` sh
439
- git checkout --orphan < branch_name >
438
+ git checkout --orphan < branch-name >
440
439
```
441
440
442
441
## 展示任意分支某一文件的内容
443
442
``` sh
444
- git show < branch_name > :< file_name >
443
+ git show < branch-name > :< file-name >
445
444
```
446
445
447
446
## clone下来指定的单一分支
0 commit comments