Skip to content

Add a tip to omit writing branch names when push #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 4, 2021
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