Merge pull request #197 from Masa-Shin/add-git-push-tip

Add a tip to omit writing branch names when push
This commit is contained in:
hemanth.hm 2021-05-04 15:11:31 -07:00 committed by GitHub
commit ba02cea81b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -171,6 +171,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)
@ -1223,6 +1224,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>

View File

@ -511,6 +511,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>"
}, {