Skip to content

Commit 7653169

Browse files
Merge pull request #128 from heidivanparys/switch
Add aliases for `git switch` and `switch --create`
2 parents 1e46c48 + 0abae6d commit 7653169

7 files changed

Lines changed: 52 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ git status:
178178
* [git ss](doc/git-ss/) = status --short
179179
* [git ssb](doc/git-ssb/) = status --short --branch
180180

181+
git switch:
182+
* [git sw](doc/git-sw/) = switch
183+
* [git swc](doc/git-swc/) = switch --create
184+
181185
git whatchanged:
182186

183187
* [git w](doc/git-w/) = whatchanged
@@ -633,6 +637,8 @@ Use graphviz:
633637
* [git svn-c](doc/git-svn-c/) - Subversion commit
634638
* [git svn-cp](doc/git-svn-cp/) - Subversion cherry pick
635639
* [git svn-m](doc/git-svn-m/) - Subversion merge
640+
* [git sw](doc/git-sw/) - Short for "git switch"
641+
* [git swc](doc/git-swc/) - Short for "git switch --create"
636642
* [git tags](doc/git-tags/) - List tags
637643
* [git theirs](doc/git-theirs/) - Checkout their version of a file and add it
638644
* [git top](doc/git-top/) - Get the top level directory name

doc/git-sw/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
index.md

doc/git-sw/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# git sw
2+
3+
## Short for "git switch"
4+
5+
Git alias:
6+
7+
```git
8+
sw = switch
9+
```
10+
11+
Example:
12+
13+
```shell
14+
git sw main
15+
```

doc/git-swc/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
index.md

doc/git-swc/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# git swc
2+
3+
## Short for "git switch --create"
4+
5+
Git alias:
6+
7+
```git
8+
swc = switch --create
9+
```
10+
11+
Example:
12+
13+
```shell
14+
git swc mytopic
15+
```

doc/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ git submodule:
172172
* [git smui](git-smui/) = submodule update --init
173173
* [git smuir](git-smuir/) = submodule update --init --recursive
174174

175+
git switch:
176+
* [git sw](git-sw/) = switch
177+
* [git swc](git-swc/) = switch --create
178+
175179
git status:
176180

177181
* [git s](git-s/) = status
@@ -621,6 +625,8 @@ Use graphviz:
621625
* [git svn-c](git-svn-c/) - Subversion commit
622626
* [git svn-cp](git-svn-cp/) - Subversion cherry pick
623627
* [git svn-m](git-svn-m/) - Subversion merge
628+
* [git sw](git-sw/) - Short for "git switch"
629+
* [git swc](git-swc/) - Short for "git switch --create"
624630
* [git tags](git-tags/) - List tags
625631
* [git theirs](git-theirs/) - Checkout their version of a file and add it
626632
* [git top](git-top/) - Get the top level directory name

gitalias.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,14 @@
468468

469469
# status with short format and showing branch and tracking info.
470470
ssb = status --short --branch
471+
472+
### switch aliases ###
473+
474+
# switch
475+
sw = switch
476+
477+
# switch --create
478+
swc = switch --create
471479

472480
### worktree aliases ###
473481

0 commit comments

Comments
 (0)