{"id":17182383,"url":"https://github.com/simoncropp/githubsync","last_synced_at":"2025-04-13T16:11:56.798Z","repository":{"id":12348783,"uuid":"14993254","full_name":"SimonCropp/GitHubSync","owner":"SimonCropp","description":"A tool to help synchronizing specific files and folders across GitHub hosted repositories","archived":false,"fork":false,"pushed_at":"2025-04-09T00:40:57.000Z","size":1336,"stargazers_count":23,"open_issues_count":1,"forks_count":11,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-13T16:11:48.834Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/SimonCropp.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"license.txt","code_of_conduct":"code_of_conduct.md","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},"funding":{"github":"SimonCropp"}},"created_at":"2013-12-06T20:57:14.000Z","updated_at":"2025-04-09T00:41:01.000Z","dependencies_parsed_at":"2024-01-10T03:28:30.327Z","dependency_job_id":"20aed99f-c47a-4e3a-8947-815f4945432d","html_url":"https://github.com/SimonCropp/GitHubSync","commit_stats":{"total_commits":1053,"total_committers":17,"mean_commits":61.94117647058823,"dds":0.6058879392212726,"last_synced_commit":"dc3979b78e5e12c6327e4d16279882a799c7a274"},"previous_names":["particular/syncomatic"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonCropp%2FGitHubSync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonCropp%2FGitHubSync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonCropp%2FGitHubSync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonCropp%2FGitHubSync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SimonCropp","download_url":"https://codeload.github.com/SimonCropp/GitHubSync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248741198,"owners_count":21154255,"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-10-15T00:36:56.489Z","updated_at":"2025-04-13T16:11:56.774Z","avatar_url":"https://github.com/SimonCropp.png","language":"C#","funding_links":["https://github.com/sponsors/SimonCropp"],"categories":[],"sub_categories":[],"readme":"\u003c!--\nGENERATED FILE - DO NOT EDIT\nThis file was generated by [MarkdownSnippets](https://github.com/SimonCropp/MarkdownSnippets).\nSource File: /readme.source.md\nTo change this file edit the source file and then run MarkdownSnippets.\n--\u003e\n\n# \u003cimg src=\"/src/icon.png\" height=\"30px\"\u003e GitHubSync\n\n[![Build status](https://ci.appveyor.com/api/projects/status/sjkccpx6avnw8vbv/branch/main?svg=true)](https://ci.appveyor.com/project/SimonCropp/GitHubSync)\n[![NuGet Status](https://img.shields.io/nuget/v/GitHubSync.svg?label=GitHubSync)](https://www.nuget.org/packages/GitHubSync/)\n[![NuGet Status](https://img.shields.io/nuget/v/GitHubSync.Tool.svg?label=dotnet%20tool)](https://www.nuget.org/packages/GitHubSync.Tool/)\n\nA tool to help synchronizing specific files and folders across repositories\n\n**See [Milestones](../../milestones?state=closed) for release notes.**\n\n\n## .net API\n\n\n### NuGet package\n\nhttps://nuget.org/packages/GitHubSync/\n\n\n### Usage\n\n\u003c!-- snippet: usage --\u003e\n\u003ca id='snippet-usage'\u003e\u003c/a\u003e\n```cs\n// Create a new RepoSync\nvar repoSync = new RepoSync(\n    log: Console.WriteLine);\n\n// Add source repo(s)\nrepoSync.AddSourceRepository(new(\n    // Valid credentials for the source repo and all target repos\n    credentials: octokitCredentials,\n    owner: \"UserOrOrg\",\n    repository: \"TheSingleSourceRepository\",\n    branch: \"master\"));\n\n// Add sources(s), only allowed when SyncMode == ExcludeAllByDefault\nrepoSync.AddBlob(\"sourceFile.txt\");\nrepoSync.AddBlob(\"code.cs\");\n\n// Remove sources(s), only allowed when SyncMode == IncludeAllByDefault\nrepoSync.AddBlob(\"sourceFile.txt\");\nrepoSync.AddBlob(\"code.cs\");\n\n// Add target repo(s)\nrepoSync.AddTargetRepository(new(\n    credentials: octokitCredentials,\n    owner: \"UserOrOrg\",\n    repository: \"TargetRepo1\",\n    branch: \"master\"));\n\nrepoSync.AddTargetRepository(new(\n    credentials: octokitCredentials,\n    owner: \"UserOrOrg\",\n    repository: \"TargetRepo2\",\n    branch: \"master\"));\n\n// Run the sync\nawait repoSync.Sync(syncOutput: SyncOutput.MergePullRequest);\n```\n\u003csup\u003e\u003ca href='/src/Tests/Snippets.cs#L5-L42' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-usage' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n\n## dotnet Tool\n\nThis tool allows reading the configuration from a file. This allows customization of the templates and repositories without\nhaving to recompile any code.\n\n\n### Installation\n\nEnsure [dotnet CLI is installed](https://docs.microsoft.com/en-us/dotnet/core/tools/).\n\nInstall [GitHubSync.Tool](https://nuget.org/packages/GitHubSync.Tool/)\n\n```ps\ndotnet tool install -g GitHubSync.Tool\n```\n\n\n### Usage\n\nRun against the current directory will use `githubsync.yaml` in the current directory:\n\n```ps\ngithubsync\n```\n\nRun against a specific config file:\n\n```ps\ngithubsync C:\\Code\\Project\\sync.yaml\n```\n\n\n### Configuration definition\n\nThe configuration format is yaml. There should be 1 to n number of templates and 1 to n number of (target) repositories.\n\n```yaml\ntemplates:\n  - name: [template name]\n    url: [repository url of the template]\n    branch: [branch to use, defaults to `master`]\n    \nrepositories:\n  - name: [repository name]\n    url: [repository url of the target repository]\n    branch: [target branch, defaults to `master`]\n    autoMerge: [true / false, true is only used when user is allowed to merge PRs on the target repository]\n    templates:\n      - [list of template names to use in the order to apply]\n```\n\n\n### Example\n\n```yaml\ntemplates:\n  - name: geertvanhorrik\n    url: https://github.com/geertvanhorrik/repositorytemplate\n    branch: master\n  - name: catel\n    url: https://github.com/Catel/RepositoryTemplate.Components\n    branch: master\n  - name: wildgums-components-public\n    url: https://github.com/wildgums/RepositoryTemplate.Components.Public\n    branch: master\nrepositories:\n  - name: CsvHelper\n    url: https://github.com/JoshClose/CsvHelper\n    branch: master\n    autoMerge: false\n    templates:\n      - geertvanhorrik\n  - name: Catel\n    url: https://github.com/catel/catel\n    branch: develop\n    autoMerge: true\n    templates:\n      - geertvanhorrik\n      - catel\n  - name: Orc.Controls\n    url: https://github.com/wildgums/orc.controls\n    branch: develop\n    autoMerge: true\n    templates:\n      - geertvanhorrik\n      - wildgums-components-public\n```\n\nThis example will result in the following:\n\n* CsvHelper =\u003e use geertvanhorrik\n* Catel =\u003e use geertvanhorrik + catel (combined, so catel can override files)\n* Orc.Controls =\u003e use geertvanhorrik + wildgums-components-public (combined, so wildgums-components-public can override files)\n\n\n## Icon\n\n[Sync](https://thenounproject.com/term/sync/290/) designed by [Edward Boatman](https://thenounproject.com/edward) from [The Noun Project](https://thenounproject.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimoncropp%2Fgithubsync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimoncropp%2Fgithubsync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimoncropp%2Fgithubsync/lists"}