{"id":29373480,"url":"https://github.com/suraj-sedai/my_vcs","last_synced_at":"2026-05-19T09:06:00.389Z","repository":{"id":296935573,"uuid":"994497148","full_name":"Suraj-Sedai/my_vcs","owner":"Suraj-Sedai","description":"A simple Git-like version control system built from scratch using Python. It supports basic commands such as init, add, commit, log, branch, checkout, and merge.","archived":false,"fork":false,"pushed_at":"2025-06-07T22:19:17.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-09T19:54:09.600Z","etag":null,"topics":["clone","command-line","dsa","dsa-algorithm","git","project","python","vcs","version-control"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Suraj-Sedai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-02T03:05:54.000Z","updated_at":"2025-06-07T22:19:22.000Z","dependencies_parsed_at":"2025-06-08T01:34:11.669Z","dependency_job_id":null,"html_url":"https://github.com/Suraj-Sedai/my_vcs","commit_stats":null,"previous_names":["suraj-sedai/my_vcs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Suraj-Sedai/my_vcs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Suraj-Sedai%2Fmy_vcs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Suraj-Sedai%2Fmy_vcs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Suraj-Sedai%2Fmy_vcs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Suraj-Sedai%2Fmy_vcs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Suraj-Sedai","download_url":"https://codeload.github.com/Suraj-Sedai/my_vcs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Suraj-Sedai%2Fmy_vcs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33209447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-19T07:54:09.561Z","status":"ssl_error","status_checked_at":"2026-05-19T07:54:08.508Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clone","command-line","dsa","dsa-algorithm","git","project","python","vcs","version-control"],"created_at":"2025-07-09T18:37:35.853Z","updated_at":"2026-05-19T09:06:00.384Z","avatar_url":"https://github.com/Suraj-Sedai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mini Version Control System (MyVCS)\n\nA simple Git-like version control system built from scratch using Python.  \nIt supports basic commands such as `init`, `add`, `commit`, `log`, `branch`, `checkout`, and `merge`.\n\n## Features\n\n- `init` – Initialize a new repository\n- `add \u003cfilename\u003e` – Stage files for commit\n- `commit -m \"message\"` – Save a snapshot of staged files\n- `log` – View commit history\n- `branch \u003cname\u003e` – Create a new branch\n- `checkout \u003cbranch\u003e` – Switch to a different branch\n- `merge \u003cbranch\u003e` – Merge another branch into the current one\n\n## How to Use\n\n```bash\n# Initialize a repository\npython main.py init\n\n# Stage files\npython main.py add myfile.txt\n\n# Commit changes\npython main.py commit -m \"Initial commit\"\n\n# View commit history\npython main.py log\n\n# Create a new branch\npython main.py branch dev\n\n# Switch to a branch\npython main.py checkout dev\n\n# Merge a branch\npython main.py merge dev\n```\n\n## How It Works\n\n- All metadata is stored in a hidden `.vcs/` folder\n- Commits are saved as JSON files in `.vcs/commits/`\n- Branches are stored as text files in `.vcs/branches/`\n- Uses SHA-1 hashes to generate unique commit IDs\n- Tracks files by saving their full content in each commit\n\n## Folder Structure\n\n```\n.vcs/\n├── HEAD                  ← Current branch name\n├── branches/             ← One file per branch (points to commit)\n├── commits/              ← One JSON file per commit\n└── staging_area.json     ← List of files staged for commit\n```\n\n## Example Output\n\n### 1. Initializing a Repository\n```bash\n$ python main.py init\nInitialized empty VCS repository in .vcs/\n```\n\n### 2. Staging and Committing\n```bash\n$ python main.py add file.txt\nAdded 'file.txt' to staging area.\n\n$ python main.py commit -m \"First commit\"\n[a1b2c3d] First commit\n```\n\n### 3. Viewing History\n```bash\n$ python main.py log\nCommit: a1b2c3d\nMessage: First commit\nDate: 2025-06-01 21:10:11\n```\n\n### 4. Branching and Merging\n```bash\n$ python main.py branch dev\nCreated branch 'dev' at commit a1b2c3d\n\n$ python main.py checkout dev\nSwitched to branch 'dev' at commit a1b2c3d\n\n$ python main.py merge dev\nMerge complete. Created commit e4f5g6h\n```\n\n## Requirements\n\n- Python 3.x\n- No third-party packages required\n- Uses only: `os`, `json`, `argparse`, `hashlib`, `time`, `datetime`\n\n## License\n\nMIT License – free to use, modify, and share.\n\n## Credits\n\nBuilt with ❤️ by a student learning data structures through real-world projects.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuraj-sedai%2Fmy_vcs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuraj-sedai%2Fmy_vcs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuraj-sedai%2Fmy_vcs/lists"}