Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

git - Copy bitbucket repo and preserve pull requests

Is there a way to copy a bitbucket repo to new project, but preserve all pull requests/code reviews?

I'm aware that you can do a git clone, in which case you have a copy of code and commits. But, it seems like pull requests are gone.

I think importing a repo has the same problem (https://support.atlassian.com/bitbucket-cloud/docs/import-a-repository/). I don't think pull requests are preserved.

I'm also aware you can "move" a repository. But that would wipe out the original repo. That's not ideal since I want the original repo still around so I could refer back to it.

Am I missing something obvious? I suppose you could make a copy of the whole SQL database, but that seems a bit hacky to me. After all, I need to migrate a single repo, not everything.

question from:https://stackoverflow.com/questions/65946274/copy-bitbucket-repo-and-preserve-pull-requests

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

1 Reply

0 votes
by (71.8m points)

The problem is that there is really no such thing as a pull request.

A pull request is a hack, an illusion created by these clever remote hosts like GitHub and Bitbucket. It's not a Git feature, and it isn't part of the repo in any standard sense.

So when you copy the repo (e.g. by cloning), there is no "pull request" in it. You can see the branches that were created in order to request that they be merged, but you cannot see the "pull request" per se, as it is not a thing as far as Git is aware. The pull request and the code review are part of Bitbucket, not part of Git or the repo.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...