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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

30,938 views 26 12
Join discussion

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