mirror of
https://github.com/git-tips/tips.git
synced 2024-09-21 00:01:03 +02:00
Add alternative for git checkout -
This commit is contained in:
parent
f20a28ac7d
commit
1274a98aba
|
@ -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
|
||||||
|
|
|
@ -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",
|
||||||
|
@ -458,4 +459,4 @@
|
||||||
}, {
|
}, {
|
||||||
"title": "Backup untracked files.",
|
"title": "Backup untracked files.",
|
||||||
"tip": "git ls-files --others -i --exclude-standard | xargs zip untracked.zip"
|
"tip": "git ls-files --others -i --exclude-standard | xargs zip untracked.zip"
|
||||||
}]
|
}]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user