File tree Expand file tree Collapse file tree 4 files changed +16
-7
lines changed Expand file tree Collapse file tree 4 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -135,9 +135,9 @@ Publishing:
135
135
Git alias:
136
136
137
137
``` git
138
- publish = "!git push -u origin $(git current-branch)"
138
+ publish = "!f() { git push -u ${1:- origin} $(git current-branch); }; f "
139
139
140
- unpublish = "!git push origin :$(git current-branch)"
140
+ unpublish = "!f() { git push ${1:- origin} :$(git current-branch); }; f "
141
141
```
142
142
143
143
Branching:
Original file line number Diff line number Diff line change 5
5
Git alias:
6
6
7
7
``` git
8
- publish = !" git push --set-upstream origin $(git current-branch)"
8
+ publish = "!f() { git push --set-upstream ${1:- origin} $(git current-branch); }; f "
9
9
```
10
10
11
- Publish the current branch by pushing upstream to origin,
11
+ Publish the current branch by pushing to the remote specified by the first argument (defaulting to origin) ,
12
12
and setting the current branch to track the upstream branch.
13
13
14
14
Example:
15
15
16
16
``` shell
17
+ # pushing to origin
17
18
git publish
19
+
20
+ # pushing to fork
21
+ git publish fork
18
22
```
19
23
20
24
Compare:
Original file line number Diff line number Diff line change 5
5
Git alias:
6
6
7
7
``` git
8
- unpublish = !" git push origin :$(git current-branch)"
8
+ unpublish = "!f() { git push ${1:- origin} :$(git current-branch); }; f "
9
9
```
10
10
11
11
Unpublish the current branch by deleting the
12
12
remote version of the current branch.
13
+ The remote name may be specified by the first argument and defaults to ` origin ` .
13
14
14
15
Example:
15
16
16
17
``` shell
18
+ # unpublish on origin
17
19
git unpublish
20
+
21
+ # unpublish branch on fork
22
+ git unpublish fork
18
23
```
19
24
20
25
Compare:
Original file line number Diff line number Diff line change 1372
1372
1373
1373
# Publish the current branch by pushing it to the remote "origin",
1374
1374
# and setting the current branch to track the upstream branch.
1375
- publish = " ! git push --set-upstream origin \" $( git current-branch) \" "
1375
+ publish = " ! f() { git push --set-upstream \" ${1 :- origin} \" \" $( git current-branch) \" ; } ; f "
1376
1376
1377
1377
# Unpublish the current branch by deleting the
1378
1378
# remote version of the current branch.
1379
- unpublish = " ! git push origin :\" $( git current-branch) \" "
1379
+ unpublish = " ! f() { git push \" ${1 :- origin} \" :\" $( git current-branch) \" ; } ; f "
1380
1380
1381
1381
# ## inbound & outbound ###
1382
1382
You can’t perform that action at this time.
0 commit comments