{"id":49447968,"url":"https://github.com/aadityansha06/snip","last_synced_at":"2026-04-29T23:34:04.634Z","repository":{"id":307951121,"uuid":"1031190072","full_name":"aadityansha06/snip","owner":"aadityansha06","description":"A version control system like git made using C , which can init , commit , store the changes made in the project as different version, retrieve previous version , also can compare any two versions by detecting the code deletion and insertion","archived":false,"fork":false,"pushed_at":"2026-02-05T15:54:48.000Z","size":92,"stargazers_count":13,"open_issues_count":2,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-06T01:54:43.615Z","etag":null,"topics":["c","file-handling-in-c","git","hacktoberfest","hacktoberfest2025","linked-list","make-dir"],"latest_commit_sha":null,"homepage":"https://github.com/aadityansha06/snip/releases/tag/1.01","language":"C","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/aadityansha06.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-03T07:54:06.000Z","updated_at":"2026-02-05T16:02:07.000Z","dependencies_parsed_at":"2025-08-03T09:06:25.458Z","dependency_job_id":"7158f1d2-4fa2-4d62-a1b3-13ca6ac0512d","html_url":"https://github.com/aadityansha06/snip","commit_stats":null,"previous_names":["aadityansha06/snip"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aadityansha06/snip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aadityansha06%2Fsnip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aadityansha06%2Fsnip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aadityansha06%2Fsnip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aadityansha06%2Fsnip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aadityansha06","download_url":"https://codeload.github.com/aadityansha06/snip/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aadityansha06%2Fsnip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32448461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"ssl_error","status_checked_at":"2026-04-29T22:10:49.234Z","response_time":110,"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":["c","file-handling-in-c","git","hacktoberfest","hacktoberfest2025","linked-list","make-dir"],"created_at":"2026-04-29T23:34:04.100Z","updated_at":"2026-04-29T23:34:04.626Z","avatar_url":"https://github.com/aadityansha06.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# snip - Lightweight Git-like Version Control System\n\n`snip` is a minimal yet powerful command-line version control system written in C. It provides Git-like functionality for tracking file changes, managing versions, and comparing code across different commits - all stored locally in a `.snip` directory.\n\nReady to use! No compilation needed - just download and run.\n\n---\n\n## What it does\n\nThe tool lets you track changes to your files locally without needing a full Git setup. It's got basic version control features like committing changes, viewing history, restoring old versions, and comparing different versions side-by-side. Everything gets stored in a `.snip` folder in your project directory.\n\nIt works from any subdirectory in your project, which is pretty convenient. You can run it in two modes - either type `snip` to get an interactive prompt, or just run commands directly from your terminal. Works on Windows, Linux, and macOS.\n\n## Installation\n\n### Quick Setup (Recommended)\n\nGet the latest `snip.exe` from the [Releases page](https://github.com/aadityansha06/snip/releases) and put it somewhere like `C:\\tools\\snip\\`. Add that folder to your PATH so you can run it from anywhere. Restart your terminal and you're good to go.\n\nCheck if it works:\n```bash\nsnip --version\n```\n\n### Building from source\n\nIf you want to compile it yourself:\n```bash\ngcc -o snip snip.c\n```\n\n---\n\n## How to use it\n\n### Interactive mode\n\nJust run `snip` without any arguments and you'll get a command prompt:\n\n```bash\nsnip\n# Welcome to snip\n# Enter snip --help for help\n# Enter snip --exit to exit\n# \n# Enter your command..\n```\n\n### Direct commands\n\nOr run commands straight away:\n```bash\nsnip init\nsnip add -main.c\nsnip commit -main.c -m\"initial commit\"\n```\n\n---\n\n## Commands\n\n| Command | What it does | Example |\n|---------|-------------|---------|\n| `init` | Start tracking in current directory | `snip init` |\n| `add` | Track a specific file | `snip add -main.c` |\n| `commit` | Save current version with a message | `snip commit -main.c -m\"fixed bug\"` |\n| `log` | Show all saved versions | `snip log -main.c` |\n| `write` | Restore an old version | `snip write -main.c v-2` |\n| `compare` | Compare two versions | `snip compare -main.c v-1 and v-2` |\n| `--version` | Check which version you're running | `snip --version` |\n| `--help` | Show help info | `snip --help` |\n| `--exit` | Exit interactive mode | `snip --exit` |\n\nNote: In interactive mode, you still type the full command including `snip` at the start.\n\n---\n\n## Getting started\n\n### Basic workflow\n\nFirst, check everything's working:\n```bash\nsnip --version\n```\n\nStart tracking your project:\n```bash\nsnip init\n```\n\nAdd a file you want to track:\n```bash\nsnip add -hello.c\n```\n\nMake your first commit:\n```bash\nsnip commit -hello.c -m\"initial version\"\n```\n\nSee what you've saved:\n```bash\nsnip log -hello.c\n```\n\nThe output looks something like:\n```\n\t+-----+-----------------------------------------------------------------------------+\n\t| Time                 | \t\tCommit-msg                | version |\n\t+-----+-----------------------------------------------------------------------------+\n\t| 05-08-2025 14:30:22 | initial version                        | 1      |\n\t+-----+-----------------------------------------------------------------------------+\n\nUse snip write \"-filename -version\"..  to overwrite previous version\n```\n\nIf you mess something up and want to go back:\n```bash\nsnip write -hello.c v-1\n```\n\n---\n\n## Comparing versions\n\nYou can compare any two versions in your code editor:\n```bash\nsnip compare -main.c v-1 and v-3\n```\n\nThe tool will try to open the diff in whatever IDE you have installed. It checks for VS Code, PyCharm, Sublime Text, and on Linux it also tries Meld. If it can't find anything, it'll let you know.\n\nAfter you're done comparing, press `1` to clean up the temporary files it created.\n\n## How it finds your files\n\nThe nice thing about snip is you don't have to be in the exact directory where you initialized it. It searches upward through parent directories to find the `.snip` folder and your source files. So you can run commands from anywhere in your project tree.\n\n## Directory structure\n\nWhen you run `snip init`, it creates a `.snip` folder with subfolders for each file you track. Inside those are version files and a log.txt with your commit history.\n\nFull disclosure: I used AI to generate the fancy tree diagrams and formatted output examples in this documentation because honestly I don't have time to mess with that UI stuff. The code itself is all me though.\n\n---\n\n## Example workflows\n\n### Tracking multiple files\n\n```bash\nsnip init\nsnip add -main.c\nsnip add -utils.h\nsnip add -config.txt\n\nsnip commit -main.c -m\"added main function\"\nsnip commit -utils.h -m\"helper functions\"\n\nsnip log -main.c\n```\n\n### Working on something experimental\n\n```bash\n# Save your working version first\nsnip commit -script.py -m\"working version before optimization\"\n\n# Make your changes to script.py...\n\n# Commit the new version\nsnip commit -script.py -m\"optimized algorithm performance\"\n\n# See what changed\nsnip compare -script.py v-1 and v-2\n\n# Roll back if the optimization broke something\nsnip write -script.py v-1\n```\n\n### Using interactive mode\n\n```bash\nsnip\n\nEnter your command.. snip init\nEnter your command.. snip add -main.c\nEnter your command.. snip commit -main.c -m\"first commit\"\nEnter your command.. snip log -main.c\nEnter your command.. snip --exit\n```\n\n---\n\n## Things to keep in mind\n\n### Command syntax rules\n\nFile names need a dash in front: `-main.c`, `-script.py`\n\nCommit messages with spaces need quotes: `-m\"your message here\"`\n\nVersions use `v-` prefix: `v-1`, `v-2`\n\nWhen comparing, use `and` between versions: `v-1 and v-2`\n\n### Requirements\n\nFiles have to exist somewhere in your current directory or above it. The `.snip` folder needs to be in the same directory tree as your files. File extensions get preserved when versions are stored.\n\n### How versioning works\n\nVersions start at 1 and go up automatically. The most recent version shows up at the top when you run `log`. Each commit makes a complete copy of your file, not just the changes. There's no size limit except your disk space.\n\n---\n\n## Known problems\n\nI built this in about 3 days so there's definitely some rough edges.\n\n### Parsing issues\n\nDon't use tab characters in your commit messages because those are used as delimiters internally. File names with spaces might cause problems. Some special characters in file names don't work properly.\n\n### Platform stuff\n\nThe code uses Windows-style path separators internally which might cause issues if you're mixing environments. There are some differences in how arguments get parsed between command line and interactive mode. IDE detection depends on having the programs in your system PATH.\n\n### Performance and memory\n\nIt creates complete copies of files, so it's not efficient for really large files. If you have tons of versions, loading the log reads everything into memory at once. Old versions never get cleaned up automatically, they just sit there forever.\n\n---\n\n## Things that could be better\n\nSome ideas for future improvements:\n\nBetter argument parsing with something like `getopt`\n\nSupport for binary files\n\nBranching and merging\n\nConfiguration files\n\nStore diffs instead of complete copies\n\nAutomatic cleanup of old versions\n\nBetter error handling and validation\n\nUnit tests\n\nBetter cross-platform path handling\n\n---\n\n## Contact and support\n\n**Report bugs or suggest features:** [GitHub Issues](https://github.com/aadityansha06/snip/issues)\n\n**View releases and download:** [GitHub Releases](https://github.com/aadityansha06/snip/releases)\n\n**Follow for updates:**\n- Twitter: [@aadityansha_06](https://x.com/aadityansha_06)\n- Telegram: [@Aadityansha](https://t.me/Aadityansha)\n\n**Project Repository:** [https://github.com/aadityansha06/snip](https://github.com/aadityansha06/snip)\n\n---\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\nYou are free to:\n- Use this software for any purpose\n- Copy, modify, and distribute it\n- Include it in proprietary applications\n\nThe only requirement is to include the original license notice.\n\n---\n\n## Contributing\n\nWant to contribute? Great! Please check out the [Contributing Guide](Developer-Docs/CONTRIBUTING.md) to learn how to follow our code conventions and contribute to the project.\n\n---\n\n## Credits\n\nGot help from AI tools for the IDE detection logic. Thanks to everyone who gave feedback and suggestions.\n\n---\n\nPro tip: This works best for small to medium text files where you need quick version tracking without Git's complexity. Perfect for scripts, config files, and small projects.\n\nPerformance note: Each commit stores a complete copy of your file, so it's simple but can use a lot of disk space if you have large files or tons of versions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faadityansha06%2Fsnip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faadityansha06%2Fsnip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faadityansha06%2Fsnip/lists"}