Keeping the plug up to date

I wanted to transfer something to the github repository, but I (obviously) had no rights to it. I made a fork of this repo, made my changes and applied for a request. Now the problem is that after some time other people made the initial repo, which means that my plug has ceased to be relevant.

How to update your plug now? Is this a ( https://stackoverflow.com/a/3188/... ) valid way, or do I need to remove my repo and make a new fork every time?

Here's what the plug looks like on the github desktop:

enter image description here

A pull request was made by me, but the two fixations after that were made by other people. They are not contained in my repo ...

+5
source share
3 answers

To synchronize your fork changes with the original repository, you must configure a remote one that points to the reverse repository in Git.

Specify a new remote reverse repository to be synchronized with the fork.

git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git

You can check if this was successful with:

git remote -v

Then download it to update your project:

git fetch upstream

Combine the changes from upstream / master into your local master branch.

git merge upstream/master

Finally, you can commit the new update from the source repository to your fork repository.

This information can also be found on GitHub here and here .

+8
source

Adding to the Diki Andriansyahanswer, not using

git merge upstream/master

try using:

git pull upstream master

It helps me:).

+3

, docker , , .

fork-sync

README , , , , , . , . - crontab , .

I wanted to be able to make branches that followed my fork from the top upstream. This could be done using git checkout -b mybranch upstream/master. But this defaults to being set upstreamto remote, which means that if I pushgo to the upstreamrepository, my branch will probably invoke CI jobs. Now I can do it git checkout -b mybranch origin/masterand I don’t need to worry about the dangerous shock that awaits me later.

0
source

Source: https://habr.com/ru/post/1662895/


All Articles