Skip to content

Commit b09c59c

Browse files
committed
Add tips to omit writing branch names when push
1 parent 1a97486 commit b09c59c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Diff for: README.md

+6
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
170170
* [List all git aliases](#list-all-git-aliases)
171171
* [Show git status short](#show-git-status-short)
172172
* [Checkout a commit prior to a day ago](#checkout-a-commit-prior-to-a-day-ago)
173+
* [Push the current branch to the same name on the remote repository](#push-the-current-branch-to-the-same-name-on-the-remote-repository)
173174
* [Push a new local branch to remote repository and track](#push-a-new-local-branch-to-remote-repository-and-track)
174175
* [Change a branch base](#change-a-branch-base)
175176
* [Use SSH instead of HTTPs for remotes](#use-ssh-instead-of-https-for-remotes)
@@ -1213,6 +1214,11 @@ git status --short --branch
12131214
git checkout master@{yesterday}
12141215
```
12151216
1217+
## Push the current branch to the same name on the remote repository
1218+
```sh
1219+
git push origin HEAD
1220+
```
1221+
12161222
## Push a new local branch to remote repository and track
12171223
```sh
12181224
git push -u origin <branch_name>

Diff for: tips.json

+3
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,9 @@
508508
"title": "Checkout a commit prior to a day ago",
509509
"tip": "git checkout master@{yesterday}"
510510
}, {
511+
"title": "Push the current branch to the same name on the remote repository",
512+
"tip": "git push origin HEAD"
513+
}, {
511514
"title": "Push a new local branch to remote repository and track",
512515
"tip": "git push -u origin <branch_name>"
513516
}, {

0 commit comments

Comments
 (0)