Merge request in different branches

I support the legacy GitHub repo now, and there are many abandoned PRs in the old branches. For example, now I work in the v3.5 branch, and PR - for 3.3 and older.

How can I effectively merge them into my new branch if they target older ones?

If this is important, I am sure that there will be no conflicts.

I found some old questions about similar things, but I can not find information on how to do this via github. You do not have functionality? Do I need to manually do this via git?

+5
source share
3 answers

There is a link to "command line commands" on the gitub.com pull-request page. If you want to do this manually, follow these steps:

  • Create a new merge branch from the PR destination branch. Checkout the merge chain. Pull PR with hashes or head refs into merge branches.
  • Merge the merge branch into a new target branch by pulling, merging, or cherry.

A few more searches found this page about renaming a branch on the github website . This implies:

  • Set the default branch to the branch of the old target. Create a branch from the branch of the old target with a different name.
  • Merge PR into a branch of the old address. Rename the branch of the old target to something else.
  • Rename another new branch to the branch name of the old target.
+3
source

All pull requests are saved here.

pull/ID/head 

You can check s pull request locally for

 git fetch REMOTENAME pull/ID/head:BRANCHNAME git checkout BRANCHNAME 

if you want all traction you can add to refetch ref

This is the address to read. Could you please return to it, please update the pull request

The remote name is the local git name for the remote

They are showing git remote -v

+1
source

Since the old branches are probably not needed, you can simply merge the transfer request to the old one (as originally requested in the stretch request), and then create a new transfer request from the old (e.g. 3.3) to a new one (e.g. 3.5) .

+1
source

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


All Articles