We've a repo with 3 branches, 2 (master, develop, these are the git-flow branches for the legacy project) of which are going to be deprecated in the near future, I'd like to know if it's possible to fork the repository only for the remaining branch, which will become the "develop" branch in the new repo.
I would keep only the last N commits (i.e. 100) on the reamining branch because it's based on the legacy branches, having lots of heavy unnecesary .jar files, so I'd like also to have a lightweight repo (as every maven / gradle project should ideally be)
Thanks in advance for your thoughts,
I'm afraid that it is not possible to fork a certain branch of a repository only or specify the number of commits you want from this branch.
One thing you can do is fork the repo, switch the main branch of the fork to "develop" from the repository Settings, and then delete the other two branches of this fork. I would also suggest contacting our support team (via https://support.atlassian.com/contact/#/) to run a git gc on the fork after you delete the branches, otherwise the commits of the deleted branches will remain on the repo as dangling commits. (I can also run a git gc if you feel comfortable sharing the URL of the repo here)
Would you need to sync the fork with the parent repo? If you won't need to sync the fork with the parent repo, another suggestion I can make is to clone only the last 100 commits of develop branch with a command like the following:
git clone repo_url --branch develop --depth 100
Then create a new repository in Bitbucket Cloud and push from that clone.
Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster ! While we’re all excited about the new improvements to Bitbucket ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events