Git usage tips (continuously updated)

Source: Internet
Author: User

Git tips: The local repo already exists, the corresponding remote repo is tiger, and the local branch is master. Question 1: When the remote repo repository for pulling code is tiger, what should I do if I want to push the changes to the develop branch of the remote Repo? Idea: Pull the new remote_develop_repo_url, merge the original code into the current branch, and then submit it to remote_develop_repo_url ,.
    1. First, submit the current modification to the local current master branch, git commit-M "this is comment"
    2. Use git remote add remote_repo_name URL to add a new remote repo and git remote add new_repo url_from_igerrit.
    3. Then, use git fetch remote_repo_name to pull the code, git branch, and its configuration locally. Git fetch new_repo
    4. Then, switch git checkout-B xx local_url to the new branch, and git checkout-B develop new_repo/develop
    5. Then merge the modifications to the master branch to the current branch. The merge command automatically commit the Merged Code to the new branch, git merge master
    6. Then, use git log to check whether the update generates a change-id. Otherwise, copy commit-MSG to the current directory. git log in the GIT/hook directory (only for the CI server to identify the Id submitted based on the change-ID)
    7. Finally, use git push remote_repo_name local_branch_name:/refs/For/remote_repo/branch_name. Git push new_repo develop: refs/to/remote_develop_branch

Question 2:

Git usage tips (continuously updated)

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.