简体   繁体   中英

Issue tracker management when merging two GitHub repos

I have two GitHub repos I am merging into one repo (Project B merging into Project A). I already understand how to merge the repos. Instead, my question is regarding the GitHub issue tracker.

On Project B, many commits referenced and closed many GitHub issues for that project. When I merge the Project B code (complete will full history) into Project A, how do I prevent GitHub from automatically referencing and closing the Project A issues with the same numbers? For example, issue #3 on Project A is completely different that issue #3 on Project B, and should not be referenced by the commit messages pulled in from Project B.

I'd like to keep the full project history of Project B, but I'm afraid this issue may keep me from doing so.

Thanks for any guidance you can provide.

I emailed GitHub support regarding this, and got this reply:

Turning off the referencing behavior is not possible currently. However, there is a workaround you might want to try.

Before you import commits from B into A, you could rewrite those commits. You would find all commit messages which contain the text "#NNN" and replace it with "user/repoB#NNN". In other words, #3 would be replaced with a more complete reference to the issue in question, so it wouldn't close issues in A (because the commit isn't referencing the issue in A, but in B).

The only problem with that approach is you would have to verify that the rewrite hasn't created a mess. You would do that in a local copy, and take a backup of the original repository. You would then verify everything looks good after the rewrite before deciding to merge the repositories.

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