简体   繁体   中英

github merging branch into fork before pulled into origin/master

So I have created a fork of Repo 1. My fork (Repo 1 Fork) has a branch (patch-1). I have filed a pull request to Repo 1. It is waiting to be merged.

Can I merge patch-1 into Repo 1 Fork?

Also, I want to create patch-2, is it best to create a new branch on Repo 1 Fork master?

you can merge commit patch1 it into a fork of repo1 (lets call it fork1). as soon as patch1 is merged into repo1 and you pull from repo1 to fork1 you will get another non-fast-forward-merge (probably), but it does automerge without conflicts when you merge a commit into a branch that you already have there.

if you want to code on another feature, it is reasonable to create another feature-branch (patch2) and it is reasonable to base it on upstream master.

Merge operations cannot be applied to repositories. They can only be applied to specific branches.

I assume that

Can I merge patch-1 into Repo-1-Fork ?

means

Can I merge my local path-1 branch (residing in Repo-1-Fork ) into my local master branch (also residing in Repo-1-Fork)?

Yes, you can. But before that, think about what suits your needs. You may want to be able to create patch-2 , patch-3 , etc. branches, and you may want for each of these branches to have an individual feature. If this is the case, it may be useful to not merge in order to keep your local master branch in sync with the Repo-1 master branch.

Then if you want you can create a developer branch in your local Repo-1-Fork in which you can merge all patch-1 , patch-2 , etc. branches so you have a version with all the intended features.

If you merge patch-1 into your local Repo-1-Fork master after all, then remember to create new single-feature branches from the remote Repo-1 master rather than from your own. Otherwise patch-2 will have both patch-1 commits and the new ones that you add to it, and you won't be able to submit a single-feature pull request from patch-2 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM