{"id":13532730,"url":"https://github.com/dflydev/git-subsplit","last_synced_at":"2025-04-09T12:07:00.505Z","repository":{"id":3935493,"uuid":"5026403","full_name":"dflydev/git-subsplit","owner":"dflydev","description":"Automate and simplify the process of managing one-way read-only subtree splits.","archived":false,"fork":false,"pushed_at":"2018-10-03T00:28:38.000Z","size":17,"stargazers_count":325,"open_issues_count":19,"forks_count":32,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-02T10:13:38.859Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/dflydev.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":"2012-07-13T22:06:04.000Z","updated_at":"2024-10-31T11:46:46.000Z","dependencies_parsed_at":"2022-09-14T15:21:30.980Z","dependency_job_id":null,"html_url":"https://github.com/dflydev/git-subsplit","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/dflydev%2Fgit-subsplit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fgit-subsplit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fgit-subsplit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dflydev%2Fgit-subsplit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dflydev","download_url":"https://codeload.github.com/dflydev/git-subsplit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036063,"owners_count":21037092,"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-08-01T07:01:13.298Z","updated_at":"2025-04-09T12:07:00.482Z","avatar_url":"https://github.com/dflydev.png","language":"Shell","funding_links":[],"categories":["版本控制系统和附加组件"],"sub_categories":["Git"],"readme":"Git Subsplit\n============\n\nAutomate and simplify the process of managing one-way read-only\nsubtree splits.\n\nGit subsplit relies on `subtree` being available. If is not available\nin your version of git (likely true for versions older than 1.7.11)\nplease install it manually from [here](https://github.com/apenwarr/git-subtree).\n\n\nInstall\n-------\n\ngit-subsplit can be installed and run standalone by executing\n`git-subsplit.sh`  directly.\n\ngit-subsplit can also be installed as a git command by:\n\n    ./install.sh\n\nCaveats\n-------\n\nThere is a known bug in the underlying git-subtree command that this script uses. Your disk will eventually run out of inodes because a cache directory isn't cleaned up after every run. I suggest you to create a cronjob to clean the cache directory every month:\n\n```\n0\t0\t1\t*\t*\t rm -rf \u003cpath to\u003e/dflydev-git-subsplit-github-webhook/temp/$projectname/.subsplit/.git/subtree-cache/*\n```\n\nHooks\n-----\n\n### GitHub WebHooks\n\n * [dflydev GitHub WebHook](https://github.com/dflydev/dflydev-git-subsplit-github-webhook) (**PHP**)\n\n\nUsage\n-----\n\n### Initialize\n\nInitialize subsplit with a git repository url:\n\n    git subsplit init https://github.com/react-php/react\n\nThis will create a working directory for the subsplit. It will contain\na clone of the project's upstream repository.\n\n\n### Update\n\nUpdate the subsplit repository with current state of its upstream\nrepository:\n\n    git subsplit update\n\nThis command should be called before one or more `publish` commands\nare called to ensure that the repository in the working directory\nhas been updated from its upstream repository.\n\n\n### Publish\n\nPublish to each subtree split to its own repository:\n\n    git subsplit publish \\\n        src/React/EventLoop:git@github.com:react-php/event-loop.git \\\n        --heads=master\n\nThe pattern for the splits is `${subPath}:${url}`. Publish can receive\nits splits argument as a space separated list:\n\n    git subsplit publish \"\n        src/React/EventLoop:git@github.com:react-php/event-loop.git\n        src/React/Stream/:git@github.com:react-php/stream.git\n        src/React/Socket/:git@github.com:react-php/socket.git\n        src/React/Http/:git@github.com:react-php/http.git\n        src/React/Espresso/:git@github.com:react-php/espresso.git\n    \" --heads=master\n\nThis command will create subtree splits of the project's repository\nbranches and tags. It will then push each branch and tag to the\nrepository dedicated to the subtree.\n\n\n#### --update\n\nPassing `--update` to the `publish` command is a shortcut for calling\nthe `update` command directly.\n\n\n#### --heads=\\\u003cheads\\\u003e\n\nTo specify a list of heads (instead of letting git-subsplit discover them\nfrom the upstream repository) you can specify them directly. For example:\n\n    --heads=\"master 2.0\"\n\nThe above will only sync the master and 2.0 branches, no matter which\nbranches the upstream repository knows about.\n\n\n#### --no-heads\n\nDo not sync any heads.\n\n\n#### --tags=\\\u003ctags\\\u003e\n\nTo specify a list of tags (instead of letting git-subsplit discover them\nfrom the upstream repository) you can specify them directly. For example:\n\n    --tags=\"v1.0.0 v1.0.3\"\n\nThe above will only sync the v1.0.0 and v1.0.3 tags, no matter which\ntags the upstream repository knows about.\n\n\n#### --no-tags\n\nDo not sync any tags.\n\n\n#### --rebuild-tags\n\nOrdinarily tags will not be synced more than once. This is because in general\ntags should be considered more or less static.\n\nIf for some reason tags need to be resynced from scratch (history changed so\ntags might point to somewhere else) this flag will get the job done.\n\n\n#### -q,--quiet\n\nAs little output as possible.\n\n\n#### -n,--dry-run\n\nDoes not actually publish information to the subsplit repos for each\nsubtree split. Instead, display the command and execute the command\nwith `--dry-run` included.\n\n#### --debug\n\nAllows you to see the logic behind the scenes.\n\n\nNot Invented Here\n-----------------\n\nInspiration for writing this came from [Guzzle's](http://guzzlephp.org/)\ngoal of providing components as individually managed packages. Having\nseen this already done by [Symfony](http://symfony.com) and liking how\nit behaved I wanted to try and see if I could solve this problem in a\ngeneral case so more people could take advantage of this workflow.\n\nMuch time was spent checking out `git-subtree` and scripts written for\nmanaging [React's](http://nodephp.org/) components.\n\n\nLicense\n-------\n\nMIT, see LICENSE.\n\n\nCommunity\n---------\n\nIf you have questions or want to help out, join us in the\n**#dflydev** channel on irc.freenode.net.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdflydev%2Fgit-subsplit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdflydev%2Fgit-subsplit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdflydev%2Fgit-subsplit/lists"}