Skip to content

About

In-memory Git simulator built from scratch. It utilizes a Directed Acyclic Graph (DAG) to track historical state and manual pointer manipulation to execute complex branching, 3-way merging, and rebasing.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

my-git

An in-memory Git simulator built in pure JavaScript. my-git implements a Directed Acyclic Graph (DAG) to accurately simulate Git's internal mechanics, handling core version control operations entirely in memory.

Features

  • In-Memory DAG: Utilizes a Directed Acyclic Graph to represent commit history and references.
  • Commits: Create standard commit objects.
  • Branching: Create, delete, and switch branches effortlessly.
  • 3-Way Merging: Implements full 3-way merge logic between branches.
  • Rebasing: Rebase branches onto new base commits, rewriting history just like the real Git.

Project Structure

  • Git.js: The core implementation of the Git simulator and the entry point for the application.
  • Git.test.js: The test suite verifying the behavior of the DAG, branching, merging, and rebasing.

Getting Started

Prerequisites

  • Node.js installed on your machine.

Installation

Clone the repository and navigate to the project directory:

git clone <repository-url>
cd my-git
npm install

Running Tests

To verify that the simulator is working correctly, you can run the test suite:

npm test

This will execute the Git.test.js file and output the test results to the console.

Usage Example

const Git = require('./Git');

// Initialize a new Git instance
const repo = new Git();

// Example usage to be expanded based on your implementation

License

ISC License

About

In-memory Git simulator built from scratch. It utilizes a Directed Acyclic Graph (DAG) to track historical state and manual pointer manipulation to execute complex branching, 3-way merging, and rebasing.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages