Gitlet is a lightweight version control system that mimics the basic features of Git. This project implements a simplified but functional version control system that helps developers track changes, maintain different versions of their code, and collaborate effectively.
Gitlet supports the following core version control operations:
- Saving Snapshots: Commit your files to save the state of your entire project
- Restoring Previous Versions: Checkout previous commits or specific files
- History Tracking: View the history of all commits through logs
- Branch Management: Create and manage different branches of development
- Merging: Combine changes from different branches
init
: Initialize a new Gitlet version-control systemadd [file name]
: Add a file to the staging areacommit [message]
: Save a snapshot of tracked files in the current commitrm [file name]
: Remove a file from trackinglog
: Display information about all commits in the current branchglobal-log
: Display information about all commits ever made
status
: Display what branches currently exist, and what files are staged, modified, or untrackedfind [commit message]
: Find all commits with a given commit message
branch [branch name]
: Create a new branchrm-branch [branch name]
: Remove a branchcheckout [args]
: Switch branches or restore filescheckout -- [file name]
: Restore a file to its state in the current commitcheckout [commit id] -- [file name]
: Restore a file to its state in the specified commitcheckout [branch name]
: Switch to a different branch
reset [commit id]
: Restore all files to their versions in the specified commitmerge [branch name]
: Merge the specified branch into the current branch
-
Initialize a new Gitlet repository:
java gitlet.Main init
-
Start tracking files:
java gitlet.Main add [file name]
-
Make your first commit:
java gitlet.Main commit "Initial commit"
The project is implemented in Java and uses various data structures and algorithms including:
- SHA-1 cryptographic hashing for commit IDs
- File persistence for storing commits and blobs
- Graph traversal for commit history
- Java collections framework
- Implements persistent storage of commits and file contents
- Uses SHA-1 hashing for unique commit identification
- Maintains a directed acyclic graph (DAG) of commits
- Handles branch management and merging
- Provides efficient file state tracking
- Java Runtime Environment (JRE)
- Java Development Kit (JDK)
- Email: [email protected]
- LinkedIn: in/VarunKandula