Questions about git push-wrong branch __ Project management/version control

Source: Internet
Author: User

Local has two branches A and b,a are release versions, B is the development version. According to the truth, a branch of the content is generally can not be arbitrarily changed, we just develop branch B on the line. Finish it again.

But today, I have a problem, that is, I did a move under branch B, GIT push origin A, very egg pain, it should be GIT push Origin B. And is my first reaction is that will not

The current branch, the B branch, is pushed to the remote a branch, so that's a hassle.

In fact, later found that I was paranoid, look at the following:

The original command format is this,

$ git push < remote host name > < local branch name >:< Remote Branch name >
But if I write git push Origin A, I omit the name of the remote branch, although I am under the B branch, but my command means to push the local a branch to the remote a branch.

The above command indicates that the local a branch is pushed to a branch of the Origin host. If the latter does not exist, it will be created.

$ GIT push origin master

$ GIT push origin test:master//submit local Test branch as remote Master Branch
$ GIT push origin test:test//submit local test branch as remote Test branch

I worry about this, a little ado about the taste, generally will not do so, generally not in a branch down to push the B branch such practices. At least, for security reasons, this is not recommended.

So I think it would be better if you could git push origin. But unfortunately I did not seem to have tried.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.