Git fork on the project to get the latest source code

Source: Internet
Author: User

There's a very powerful feature on GitHub, pull request, and when you fork a project you can drop the latest changes in the original code, keep your project consistent with the author's project, or submit your own code to the author to contribute to the open source project.

However, I did not find such a feature on Gitlab, only the functionality of the merge request that was similar to submitting your own code to the original code.

However, such requirements can be achieved through powerful commands.


1 Add a remote project source to the project you fork.

git remote add #myremote # #https://git.oschina.net/zimingforever/myhomepage.git#

2 Submitting a local change

Git commit

3 Updating a remote project

git Remote update #myremote #

4 then checkout to the specified branch, such as develop

git checkout #develop #

5 then rebase to the address of the remote project

git rebase #myremote #/#develop #

6 or direct pull under the latest remote code

Git pull # #myremote # #develop #

7 then push the latest code into the project of your fork

git push


Git fork on the project to get the latest source code

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.