json-git icon indicating copy to clipboard operation
json-git copied to clipboard

How to create the branch from specific commit?

Open caracal7 opened this issue 7 years ago • 2 comments

caracal7 avatar Feb 28 '18 23:02 caracal7

Hi, this is not possible right now. I never had enough time to finish #8 which is outdated now. I have to rewrite it to add detached mode which basically allows any commit hash to be used as well as a branch name in many commands.

Are you using json-git? What is your use case?

RobinBressan avatar Mar 01 '18 13:03 RobinBressan

Hi) Yes I try to use json-git. And I attached little bit modified gitgraph.js for flow visualisation.

2018-03-01 16 11 39

In my project I have a lot of object configurations stored in database. And I want to make complete repository of it with ability to fork(copy) repositories. Everything is working perfect and as expected. I did little correction to createRepositiory.js for storing branch name in the commit. I need it for drawing graph with gitgraph.js.

            var commitHash = commitStore.write({
                branch: repository.branch,  /// <--------------
                author: author,
                date: new Date().toISOString(),
                message: message,
                treeHash: treeHash,
                parent: repository.head
            });

The only thing I lake now for complete version control of my data is creating new branch from any commit and checkout any commit.

Thanks for great library!

Sorry for my English)

caracal7 avatar Mar 01 '18 13:03 caracal7