Skip to content

Commit 2e8cfda

Browse files
authored
Merge pull request #134 from shfshanyue/master
Add alternative for git checkout -
2 parents f20a28a + 1274a98 commit 2e8cfda

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,12 @@ git branch --merged master
229229
git checkout -
230230
```
231231

232+
233+
__Alternatives:__
234+
```sh
235+
git checkout @{-1}
236+
```
237+
232238
## Remove branches that have already been merged with master
233239
```sh
234240
git branch --merged master | grep -v '^\*' | xargs -n 1 git branch -d

tips.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"tip": "git branch --merged master"
3535
}, {
3636
"title": "Quickly switch to the previous branch",
37-
"tip": "git checkout -"
37+
"tip": "git checkout -",
38+
"alternatives": ["git checkout @{-1}"]
3839
}, {
3940
"title": "Remove branches that have already been merged with master",
4041
"tip": "git branch --merged master | grep -v '^\\*' | xargs -n 1 git branch -d",
@@ -458,4 +459,4 @@
458459
}, {
459460
"title": "Backup untracked files.",
460461
"tip": "git ls-files --others -i --exclude-standard | xargs zip untracked.zip"
461-
}]
462+
}]

0 commit comments

Comments
 (0)