Skip to content

leebrouse/Gitlet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gitlet (CS61B Project 2)

Gitlet is a simplified version-control system inspired by Git, implemented in Java as part of the UC Berkeley CS61B course. It supports basic version control operations such as add, commit, branch, checkout, merge, and more, for flat file structures.

Features

  • Initialize a repository
  • Add and remove files
  • Commit changes
  • Branch management (create, delete, switch)
  • Checkout files and branches
  • Merge branches (with basic conflict handling)
  • Log and global log
  • Status display
  • Reset to previous commits

Directory Structure

proj2/
  ├── gitlet/      # Main source code (Java)
  ├── testing/     # Test code and scripts
  ├── images/      # Project diagrams and flowcharts
  └── gitlet-design/
        ├── gitlet-design_en.md  # English design doc
        └── gitlet-design_cn.md  # Chinese design doc

Getting Started

Prerequisites

  • Java 8 or above
  • (Optional) JUnit for testing

Compile

In the proj2 directory, run:

javac gitlet/*.java

Run

To use Gitlet, run:

java gitlet.Main <command> [args]

For example:

java gitlet.Main init
java gitlet.Main add file.txt
java gitlet.Main commit "Initial commit"

Testing

See the testing/ directory for test scripts and sample test cases. You can use the provided Makefile for automated testing:

cd testing
make test

Documentation

For detailed design, implementation ideas, and diagrams, please refer to the above documents.


Reference

About

Gitlet is a simplified version-control system inspired by Git

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published