Coder Social home page Coder Social logo

cgit's Introduction

CGit: A Java-Based Version Control System

Introduction

Cgitlet is a lightweight, Java-based version control system inspired by Git. It offers essential functionalities for tracking and managing changes in your codebase, making it suitable for personal projects and learning purposes.

Features

cgitlet supports a variety of commands that are similar to Git, including but not limited to:

  • test: Runs tests for the tool.
  • add <filename>: Adds a file to the staging area.
  • commit <message>: Commits the staged changes with a given message.
  • rm <filename>: Removes a file from the current tracking and staging area.
  • log: Displays the commit history for the current branch.
  • global-log: Shows the commit history across all branches.
  • find <message>: Finds and displays commits with a specific message.
  • status: Displays the status of the working directory and staging area.
  • checkout <commit/branch>: Checks out a specific commit or branch.
  • branch <branchname>: Creates a new branch.
  • rm-branch <branchname>: Deletes a specified branch.
  • reset <commit>: Resets the current branch's head to the specified commit.
  • merge <branch>: Merges a specified branch into the current branch.

Advanced features such as handling remote repositories (add-remote, rm-remote, push, fetch, pull) are also available.

Prerequisite

  • CURL

    • Linux

      sudo apt install curl
    • Mac

      brew install curl

Installation

Building from Source

To build cgitlet from the source code, you need a Java Development Kit (JDK) installed on your system. Follow these steps:

  1. Clone the repository: git clone [URL to cgitlet repository].
  2. Navigate to the project directory: cd cgitlet.
  3. Compile the project: javac [path to java files].

Running the Pre-built Jar

If you prefer using the pre-built jar, cgitlet.jar can be downloaded and run directly. Ensure you have Java Runtime Environment (JRE) installed, then execute:

java -jar cgitlet.jar [command]

Setting Up Alias for Easy Usage

For convenience, you can set up an alias in your command-line interface. For example, in a Unix-like environment, add this line to your .bashrc or .bash_profile:

shellCopy code
alias cgit='java -jar /path/to/cgitlet.jar'

Replace /path/to/cgitlet.jar with the actual path to the cgitlet.jar file. After setting up the alias, you can use cgit followed by the commands listed above.

Contributing

We welcome contributions to cgitlet! Please read our contributing guidelines MIT for details on how to submit changes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.