简体   繁体   中英

Git push default to github

Right now if I type git push -u origin master it will push my repository to github. Is there a way to achieve the same effect but only having to type git push ?

When the command line does not specify where to push with the argument, branch.*.remote configuration for the current branch is consulted to determine where to push. If the configuration is missing, it defaults to origin.

From http://git-scm.com/docs/git-push

So the answer is: yes, that's possible. It will default to origin

By typing git config --global push.default simple in git bash I was able to achieve the desired effect. Now every time I type git push it automatically pushes to github.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM