From c8d0093f4951311d540d881a99cc52132cdee586 Mon Sep 17 00:00:00 2001 From: xueweihan <595666367@qq.com> Date: Tue, 19 Jul 2016 22:52:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 91 ++----------------------------------------------------- 1 file changed, 3 insertions(+), 88 deletions(-) diff --git a/README.md b/README.md index d153758..70aadb6 100644 --- a/README.md +++ b/README.md @@ -232,11 +232,6 @@ git ls-files --others git ls-files --others -i --exclude-standard ``` -## Create new working tree from HEAD state -```sh -git worktree add --detach HEAD -``` - ## 强制删除untracked的文件 清空工作区untracked的文件 ```sh @@ -254,62 +249,22 @@ git clean -df git branch -m ``` -## Modify previous commit without modifying the commit message -```sh -git add --all && git commit --amend --no-edit -``` - -## Prunes references to remote branches that have been deleted in the remote. -```sh -git fetch -p -``` - - -__Alternatives:__ -```sh -git remote prune origin -``` - -## Retrieve the commit hash of the initial revision. -```sh - git rev-list --reverse HEAD | head -1 -``` - ## 展示简化的commit历史 ```sh git log --pretty=oneline --graph --decorate --all ``` -## Deploying git tracked subfolder to gh-pages -```sh -git subtree push --prefix subfolder_name origin gh-pages -``` - -## Adding a project to repo using subtree -```sh -git subtree add --prefix=/ --squash git@github.com:/.git master -``` - -## Get latest changes in your repo for a linked project using subtree -```sh -git subtree pull --prefix=/ --squash git@github.com:/.git master -``` - -## Export a branch with history to a file. +## 把某一个分支到导出成一个文件 ```sh git bundle create ``` -## Import from a bundle +## 从包中导入分支 +新建一个分支,分支内容就是上面`git bundle create`命令导出的内容 ```sh git clone repo.bundle -b ``` -## Get the name of current branch. -```sh -git rev-parse --abbrev-ref HEAD -``` - ## Ignore one file on commit (e.g. Changelog). ```sh git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog @@ -366,51 +321,11 @@ git checkout ^ -- git checkout -- ``` -## Always rebase instead of merge on pull. -```sh -git config --global branch.autosetuprebase always -``` - ## 展示所有alias和configs. ```sh git config --list ``` -## Make git case sensitive. -```sh -git config --global core.ignorecase false -``` - -## Add custom editors. -```sh -git config --global core.editor '$EDITOR' -``` - -## Check if the change was a part of a release. -```sh -git name-rev --name-only -``` - -## Dry run. (any command that supports dry-run flag should do.) -```sh -git clean -fd --dry-run -``` - -## Marks your commit as a fix of a previous commit. -```sh -git commit --fixup -``` - -## squash fixup commits normal commits. -```sh -git rebase -i --autosquash -``` - -## skip staging area during commit. -```sh -git commit --only -``` - ## 展示忽略的文件 ```sh git status --ignored