lfgtm
lfgtm

Reputation: 1047

Forking a git repo into two seperate repo's as two differrent codebases

We have a bitbucket repository which has evolved somewhat since its inception and now has become another software project (evolved from the original codebase).

We would like to fork the existing repository which still reuquires future development, while at the same time continuing different development on the original repo.

e.g. we have a repo (Repo1), we want to create a new repo (Repo2) which is clone of Repo1 in a new project, and then continue development on Repo1 and Repo2 as two seperate codebases.

I'm thinking this is a simple fork, but would just like some clarification on our requirements.

  1. History from Repo1 should be preserved in Repo2 (so that Repo1's commit history is present in Repo2, upto to the point of the fork)?
  2. Development needs to continue in Repo2, but not go upstream to Repo1, since Repo1 is now considered a different codebase?
  3. We have branches in Repo1 which are not relevant to Repo2, is it a case of just deleting these branches from Repo2 that we don't need after the fork.

Is this just a case of forking Repo1? Or do I need to do extra things to ensure that there is no upstream changes, and these are considered seperate codebases/repos from now on.

Many thanks!

Upvotes: 0

Views: 29

Answers (2)

werfu
werfu

Reputation: 380

There's nothing special to do except to ensure that you remove the origin from the repo2, in order to ensure no one tries to push changes from it to repo1 down the road. After that you're free to do whatever you like to both repos without influencing one and other.

Upvotes: 1

Donat
Donat

Reputation: 4813

Just clone your Repo1 to a new repository Repo2. Repo2 has the full history of Repo1. You can do what you want with the two Repos. You need not synchronize them, if you do not want. You can also delete branches from Repo2, if you do not need them there.

Upvotes: 0

Related Questions