Skip to content

Commit c8d0093

Browse files
committed
更新
1 parent d6318ca commit c8d0093

File tree

1 file changed

+3
-88
lines changed

1 file changed

+3
-88
lines changed

README.md

Lines changed: 3 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,6 @@ git ls-files --others
232232
git ls-files --others -i --exclude-standard
233233
```
234234

235-
## Create new working tree from HEAD state
236-
```sh
237-
git worktree add --detach <path> HEAD
238-
```
239-
240235
## 强制删除untracked的文件
241236
清空工作区untracked的文件
242237
```sh
@@ -254,62 +249,22 @@ git clean -df
254249
git branch -m <new-branch-name>
255250
```
256251

257-
## Modify previous commit without modifying the commit message
258-
```sh
259-
git add --all && git commit --amend --no-edit
260-
```
261-
262-
## Prunes references to remote branches that have been deleted in the remote.
263-
```sh
264-
git fetch -p
265-
```
266-
267-
268-
__Alternatives:__
269-
```sh
270-
git remote prune origin
271-
```
272-
273-
## Retrieve the commit hash of the initial revision.
274-
```sh
275-
git rev-list --reverse HEAD | head -1
276-
```
277-
278252
## 展示简化的commit历史
279253
```sh
280254
git log --pretty=oneline --graph --decorate --all
281255
```
282256

283-
## Deploying git tracked subfolder to gh-pages
284-
```sh
285-
git subtree push --prefix subfolder_name origin gh-pages
286-
```
287-
288-
## Adding a project to repo using subtree
289-
```sh
290-
git subtree add --prefix=<directory_name>/<project_name> --squash git@github.com:<username>/<project_name>.git master
291-
```
292-
293-
## Get latest changes in your repo for a linked project using subtree
294-
```sh
295-
git subtree pull --prefix=<directory_name>/<project_name> --squash git@github.com:<username>/<project_name>.git master
296-
```
297-
298-
## Export a branch with history to a file.
257+
## 把某一个分支到导出成一个文件
299258
```sh
300259
git bundle create <file> <branch-name>
301260
```
302261

303-
## Import from a bundle
262+
## 从包中导入分支
263+
新建一个分支,分支内容就是上面`git bundle create`命令导出的内容
304264
```sh
305265
git clone repo.bundle <repo-dir> -b <branch-name>
306266
```
307267

308-
## Get the name of current branch.
309-
```sh
310-
git rev-parse --abbrev-ref HEAD
311-
```
312-
313268
## Ignore one file on commit (e.g. Changelog).
314269
```sh
315270
git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog
@@ -366,51 +321,11 @@ git checkout <deleting_commit>^ -- <file_path>
366321
git checkout <commit-ish> -- <file_path>
367322
```
368323

369-
## Always rebase instead of merge on pull.
370-
```sh
371-
git config --global branch.autosetuprebase always
372-
```
373-
374324
## 展示所有alias和configs.
375325
```sh
376326
git config --list
377327
```
378328

379-
## Make git case sensitive.
380-
```sh
381-
git config --global core.ignorecase false
382-
```
383-
384-
## Add custom editors.
385-
```sh
386-
git config --global core.editor '$EDITOR'
387-
```
388-
389-
## Check if the change was a part of a release.
390-
```sh
391-
git name-rev --name-only <SHA-1>
392-
```
393-
394-
## Dry run. (any command that supports dry-run flag should do.)
395-
```sh
396-
git clean -fd --dry-run
397-
```
398-
399-
## Marks your commit as a fix of a previous commit.
400-
```sh
401-
git commit --fixup <SHA-1>
402-
```
403-
404-
## squash fixup commits normal commits.
405-
```sh
406-
git rebase -i --autosquash
407-
```
408-
409-
## skip staging area during commit.
410-
```sh
411-
git commit --only <file_path>
412-
```
413-
414329
## 展示忽略的文件
415330
```sh
416331
git status --ignored

0 commit comments

Comments
 (0)