@@ -217,47 +217,26 @@ git stash clear
217
217
git checkout < stash@{n}> -- < file_path>
218
218
```
219
219
220
- ## Show all tracked files
220
+ ## 展示所有tracked的文件
221
221
``` sh
222
222
git ls-files -t
223
223
```
224
224
225
- ## Show all untracked files
225
+ ## 展示所有untracked的文件
226
226
``` sh
227
227
git ls-files --others
228
228
```
229
229
230
- ## Show all ignored files
230
+ ## 展示所有忽略的文件
231
231
``` sh
232
232
git ls-files --others -i --exclude-standard
233
233
```
234
234
235
- ## Create new working tree from a repository (git 2.5)
236
- ``` sh
237
- git worktree add -b < branch-name> < path> < start-point>
238
- ```
239
-
240
235
## Create new working tree from HEAD state
241
236
``` sh
242
237
git worktree add --detach < path> HEAD
243
238
```
244
239
245
- ## Untrack files without deleting
246
- ``` sh
247
- git rm --cached < file_path>
248
- ```
249
-
250
-
251
- __ Alternatives:__
252
- ``` sh
253
- git rm --cached -r < directory_path>
254
- ```
255
-
256
- ## Before deleting untracked files/directory, do a dry run to get the list of these files/directories
257
- ``` sh
258
- git clean -n
259
- ```
260
-
261
240
## 强制删除untracked的文件
262
241
清空工作区untracked的文件
263
242
``` sh
@@ -275,16 +254,6 @@ git clean -df
275
254
git branch -m < new-branch-name>
276
255
```
277
256
278
- ## rebases 'feature' to 'master' and merges it in to master
279
- ``` sh
280
- git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1}
281
- ```
282
-
283
- ## Archive the ` master ` branch
284
- ``` sh
285
- git archive master --format=zip --output=master.zip
286
- ```
287
-
288
257
## Modify previous commit without modifying the commit message
289
258
``` sh
290
259
git add --all && git commit --amend --no-edit
@@ -402,7 +371,7 @@ git checkout <commit-ish> -- <file_path>
402
371
git config --global branch.autosetuprebase always
403
372
```
404
373
405
- ## List all the alias and configs .
374
+ ## 展示所有alias和configs .
406
375
``` sh
407
376
git config --list
408
377
```
@@ -417,11 +386,6 @@ git config --global core.ignorecase false
417
386
git config --global core.editor ' $EDITOR'
418
387
```
419
388
420
- ## Auto correct typos.
421
- ``` sh
422
- git config --global help.autocorrect 1
423
- ```
424
-
425
389
## Check if the change was a part of a release.
426
390
``` sh
427
391
git name-rev --name-only < SHA-1>
0 commit comments