Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What's the difference between git push origin and git push-u origin master?

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "what is the difference between git push origin and git push-u origin master". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. Git push origin

Git push origin

The above command indicates that the current branch is pushed to the corresponding branch of the origin host. If the current branch has only one tracking branch, the hostname can be omitted.

Note: origin is a remote warehouse alias, which is done by configuring a remote warehouse

Git remote add origin http://xxxx@git.XXXX.com/scm/wbqa/xxxx.git# origin is the remote warehouse alias followed by http for the remote warehouse address

II. Git push

Git push

If the current branch has a tracking relationship with multiple hosts, the-u option specifies a default host at this time, so that git push can be used later without any parameters.

3. Git push-u origin master

Git push-u origin master

The above command pushes the local master branch to the origin host, and specifies origin as the default host, and then you can use git push without any parameters. Git push without any parameters only pushes the current branch by default, which is called simple mode. In addition, there is an matching method that pushes all local branches that have corresponding remote branches. Before Git 2.0, the matching method was used by default, but now it is changed to simple by default.

4. Upload the local master to the remote warehouse branch

Git push: git push origin master:djs# origin is the set remote repository alias, master is the local branch name, and djs is the remote branch name "what's the difference between git push origin and git push-u origin master". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report