Skip to content

Commit ba02cea

Browse files
authored
Merge pull request #197 from Masa-Shin/add-git-push-tip
Add a tip to omit writing branch names when push
2 parents 6ed1ec9 + c8eb026 commit ba02cea

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
@@ -171,6 +171,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
171171
* [List all git aliases](#list-all-git-aliases)
172172
* [Show git status short](#show-git-status-short)
173173
* [Checkout a commit prior to a day ago](#checkout-a-commit-prior-to-a-day-ago)
174+
* [Push the current branch to the same name on the remote repository](#push-the-current-branch-to-the-same-name-on-the-remote-repository)
174175
* [Push a new local branch to remote repository and track](#push-a-new-local-branch-to-remote-repository-and-track)
175176
* [Change a branch base](#change-a-branch-base)
176177
* [Use SSH instead of HTTPs for remotes](#use-ssh-instead-of-https-for-remotes)
@@ -1223,6 +1224,11 @@ git status --short --branch
12231224
git checkout master@{yesterday}
12241225
```
12251226
1227+
## Push the current branch to the same name on the remote repository
1228+
```sh
1229+
git push origin HEAD
1230+
```
1231+
12261232
## Push a new local branch to remote repository and track
12271233
```sh
12281234
git push -u origin <branch_name>

Diff for: tips.json

+3
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,9 @@
511511
"title": "Checkout a commit prior to a day ago",
512512
"tip": "git checkout master@{yesterday}"
513513
}, {
514+
"title": "Push the current branch to the same name on the remote repository",
515+
"tip": "git push origin HEAD"
516+
}, {
514517
"title": "Push a new local branch to remote repository and track",
515518
"tip": "git push -u origin <branch_name>"
516519
}, {

0 commit comments

Comments
 (0)