Adding a new commit before the Start of Branch

Sanchit Sahay November 13, 2014

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

0 votes
Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 16, 2014

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
TAGS
AUG Leaders

Atlassian Community Events