Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
718 views
in Technique[技术] by (71.8m points)

git - How can I keep my fork in sync without adding a separate remote?

Let's assume there is a repository someone/foobar on GitHub, which I forked to me/foobar.

How do I pull new commits from the parent repository directly to my fork, without having to add a separate remote and remember to pull regularly from there ?

The goal is to:

  • git pull to fetch from the parent repository
  • git push to send everything to my fork
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Open the forked Git repository me/foobar.

Click on Compare:

Here is a sample image of the page

You will get the notification:

There isn't anything to compare.
someone:master is up to date with all commits from me:master. Try switching the base for your comparison.

Click on switching the base on this page:

Here is an example on the page

Then you get to see all the commits made to someone/foobar after the day you forked it.

Click on Create pull request:

Here is a sample page

Give the pull request a title and maybe a description and click Create pull request.

On the next page, scroll to the bottom of the page and click Merge pull request and Confirm merge.

Your Git repository me/foobar will be updated.

Edit: rebase options are shown here:

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...