1.0.2 • Published 8 months ago

pit-vcs v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Pit - A Lightweight Version Control System 🚀

Pit is a simple version control system inspired by Git. It lets you track changes, commit updates, and view the history of your project. Perfect for learning how version control works or managing simple projects without the complexity of Git.


✨ Features

  • 🏁 Initialize a Repository: Create a .pit directory to track files.
  • 📂 Staging Area: Add files to a staging area before committing.
  • 💾 Commit Changes: Save the state of your files with a message.
  • 📜 View History: View a log of all commits.
  • 🔍 Show Differences: View file changes between commits.

🔧 Installation

Using npm (Recommended)

Install Pit globally using npm:

npm install -g pit

Clone from GitHub

Alternatively, clone the repository and link it globally:

git clone https://github.com/your-username/pit.git
cd pit
npm install
npm link

🚀 Usage

Pit provides a set of commands to manage your repository:

1. Initialize a Repository

Create a .pit directory in your project:

pit init

2. Add Files to Staging

Add files to the staging area:

pit add <file>

Example:

pit add sample.txt

3. Commit Changes

Save the state of your files with a message:

pit commit "<message>"

Example:

pit commit "Initial commit"

4. View Commit History

Display the log of all commits:

pit log

5. Show Differences

View file changes in a specific commit:

pit show <commitHash>

📖 Example Workflow

# Initialize a repository
pit init

# Add a file
pit add file.txt

# Commit changes
pit commit "Add file.txt"

# View commit history
pit log

# Show changes in a commit
pit show <commitHash>

⚙️ How It Works

  • .pit Directory: All tracked files, commits, and metadata are stored in a .pit directory at the project root.
  • Staging Area: Changes are staged in an index file within .pit before committing.
  • Commits: Each commit is stored as a file in .pit/objects with metadata, a message, and file contents.

🛠 Development

Prerequisites

Install Dependencies

Run the following to install dependencies:

npm install

Run Locally

Test commands directly using:

node index.js <command>

🤝 Contributing

Contributions are welcome! Follow these steps to contribute:

  1. Fork this repository.
  2. Create a branch (`git checkout -b feature/my-feature`).
  3. Commit your changes (`git commit -m "Add feature"`).
  4. Push to your branch (`git push origin feature/my-feature`).
  5. Create a Pull Request.

📜 License

This project is licensed under the MIT License.


🙏 Acknowledgements


📞 Contact

For questions or support, feel free to reach out:

  • Name: Vivek Tarun
  • Email: vivektarun1234@gmail.com
  • GitHub: Vivek Tarun EOF
1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago