Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
* [List all git aliases](#list-all-git-aliases)
* [Show git status short](#show-git-status-short)
* [Checkout a commit prior to a day ago](#checkout-a-commit-prior-to-a-day-ago)
* [Push the current branch to the same name on the remote repository](#push-the-current-branch-to-the-same-name-on-the-remote-repository)
* [Push a new local branch to remote repository and track](#push-a-new-local-branch-to-remote-repository-and-track)
* [Change a branch base](#change-a-branch-base)
* [Use SSH instead of HTTPs for remotes](#use-ssh-instead-of-https-for-remotes)
Expand Down Expand Up @@ -1213,6 +1214,11 @@ git status --short --branch
git checkout master@{yesterday}
```

## Push the current branch to the same name on the remote repository
```sh
git push origin HEAD
```

## Push a new local branch to remote repository and track
```sh
git push -u origin <branch_name>
Expand Down
3 changes: 3 additions & 0 deletions tips.json
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,9 @@
"title": "Checkout a commit prior to a day ago",
"tip": "git checkout master@{yesterday}"
}, {
"title": "Push the current branch to the same name on the remote repository",
"tip": "git push origin HEAD"
}, {
"title": "Push a new local branch to remote repository and track",
"tip": "git push -u origin <branch_name>"
}, {
Expand Down