{"id":21347303,"url":"https://github.com/zddhub/dit","last_synced_at":"2026-01-02T14:48:37.846Z","repository":{"id":36515704,"uuid":"40821421","full_name":"zddhub/dit","owner":"zddhub","description":"The simple content tracker as git does, helping you practise a new programming language","archived":false,"fork":false,"pushed_at":"2018-01-08T13:54:47.000Z","size":112,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-22T16:32:07.278Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"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/zddhub.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}},"created_at":"2015-08-16T14:08:03.000Z","updated_at":"2024-07-22T23:14:23.000Z","dependencies_parsed_at":"2022-09-13T19:50:49.232Z","dependency_job_id":null,"html_url":"https://github.com/zddhub/dit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zddhub%2Fdit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zddhub%2Fdit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zddhub%2Fdit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zddhub%2Fdit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zddhub","download_url":"https://codeload.github.com/zddhub/dit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822295,"owners_count":20353500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-22T02:13:37.966Z","updated_at":"2026-01-02T14:48:37.815Z","avatar_url":"https://github.com/zddhub.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg height=\"90\" alt=\"dit\" src=\"logo.png\"\u003e\n\n\u003e Helping you practise a new programming language\n\n[中文文档](README_CN.md)\n\nIt is difficult to master a language by practising small examples from documentation page, systematic practice is needed.\n\nWe hope to provide a good project, Dit - the simple content tracker as [Git](https://github.com/git/git) does, to get you off the ground and master a new programming language as quickly as possible.\n\n## Origin\n\n* From the love of Git and worship of [Linus](https://github.com/torvalds).\n* \"Do it together\", hope more guys participate in.\n* Learn more about Git.\n* More practice when come to learning a new programming language.\n\n## Implemented version\n\nDit has already been implemented by below programming languages:\n\n- [Golang](https://github.com/zddhub/dit/tree/golang)\n\n## Dit - The simple content tracker as Git does\n\n### Dit repository\n\nDit only implements minimal repository as below:\n\n```sh\n.dit/\n├── HEAD\n├── index\n├── objects\n└── refs\n    └── heads\n        └── master\n\n3 directories, 3 files\n```\n\n### Dit objects\n\nDit is a content-addressable filesystem. It has three objects: blob, tree and commit. Each object is named with a 40-character checksum hash and stored under `objects` folder. The subdirectory is named with the first 2 characters of the SHA-1, and the filename is the remaining 38 characters.\n\nStored content includes `object type + size + \\0 + actual content`, Dit compresses the content with `zlib`.\n\nSha1 can be calculated like below:\n\n```sh\n# git\n$ echo dit | git hash-object --stdin\n8f2c96ad676d7423d2c319fffb78cfb87c78c3e2\n\n# shasum\n$ echo -e \"blob 4\\0dit\" | shasum\n8f2c96ad676d7423d2c319fffb78cfb87c78c3e2  -\n\n# openssl sha1\n$ echo -e \"blob 4\\0dit\" | openssl sha1\n(stdin)= 8f2c96ad676d7423d2c319fffb78cfb87c78c3e2\n\n# go\nfmt.Printf(\"%x\\n\", sha1.Sum([]byte(\"blob 4\\x00dit\\n\")))\n```\n\n* blob\n\n![blob](https://www.zddhub.com/assets/images/2015-08-05/blob.png)\n\n* tree\n\n![tree](https://www.zddhub.com/assets/images/2015-08-05/tree.png)\n\n* commit\n\n![commit](https://www.zddhub.com/assets/images/2015-08-05/commit.png)\n\n### Dit commands\n\nDit is a mini Git, the basical dit must support the below commands:\n\n| Command | Description |\n| --- | --- |\n| dit init | Create an empty Dit repository or reinitialize an existing one |\n| dit add | Add file contents to the index |\n| dit commit | Record changes to the repository |\n| dit log | Show commit logs |\n| dit checkout | Restore working tree files |\n| dit diff | Show changes between commits, commit and working tree, etc |\n| dit status | Show the working tree status |\n\nDit only has master branch.\n\n## Thanks\n\n* [Git](https://github.com/git/git)\n* [Pro Git](https://git-scm.com/book/en)\n\n## License\n\nEverything in this repo is under MIT License unless otherwise specified.\n\nMIT © [zddhub](https://www.zddhub.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzddhub%2Fdit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzddhub%2Fdit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzddhub%2Fdit/lists"}