1
0
mirror of https://github.com/namibia/tips.git synced 2024-06-12 23:22:20 +00:00

Add alternative for git checkout -

This commit is contained in:
shfshanyue 2017-02-16 10:29:36 +08:00
parent f20a28ac7d
commit 1274a98aba
2 changed files with 9 additions and 2 deletions

View File

@ -229,6 +229,12 @@ git branch --merged master
git checkout - git checkout -
``` ```
__Alternatives:__
```sh
git checkout @{-1}
```
## Remove branches that have already been merged with master ## Remove branches that have already been merged with master
```sh ```sh
git branch --merged master | grep -v '^\*' | xargs -n 1 git branch -d git branch --merged master | grep -v '^\*' | xargs -n 1 git branch -d

View File

@ -34,7 +34,8 @@
"tip": "git branch --merged master" "tip": "git branch --merged master"
}, { }, {
"title": "Quickly switch to the previous branch", "title": "Quickly switch to the previous branch",
"tip": "git checkout -" "tip": "git checkout -",
"alternatives": ["git checkout @{-1}"]
}, { }, {
"title": "Remove branches that have already been merged with master", "title": "Remove branches that have already been merged with master",
"tip": "git branch --merged master | grep -v '^\\*' | xargs -n 1 git branch -d", "tip": "git branch --merged master | grep -v '^\\*' | xargs -n 1 git branch -d",