Adding a new commit before the Start of Branch

I started a private repository on Bitbucket, and was using it to save and control versions of my programs. I'm using Sourcetree to maintain local copy of repository.  

When I started, the program version I was working upon was V3.0. Over the time, as I learnt more and more about the sourcetree, and benefits of version control overall, ability to share with team mates I am working with etc.

There are only 4-5 commits on my repository. I was hoping to add my older versions as well to the branch, V1 and V2, so that I/team members can access them.

Is there a way to do that?

One way I know of is to save all the present development versions from bitbucket, save them , and re-create the repository, starting with V1..


But I hope there is another option available, and I cannot find how to do that? Can I commit these old versions, and then move before the Start of branch?

Any help would be appreciated


1 answer

You can do this:

  • create a branch with the old commits (if it does not exist already)
  • rebase the current branch on top of the one with the old commits
  • (rename branches, if needed)
  • force push

N.B. After the force push, everybody else will need to re-clone the repo.

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

691 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot