Is your feature request related to a problem? Please describe.
When creating new repositories, I would like to be able to specify that the repository is seeded from an initial repository (either a fork, or a template, in GitHub nomenclature). This action should, when working against GitHub repos, automatically create the appropriate fork/template instance instead of creating a new (unlinked) repo, enabling the "GitHub Flow" contribution workflow.
Describe the solution you'd like
I'd like to be able to provide a --from/--fork argument when running gt new, specifying a source repository from which the new repo should be seeded.
gt new gh:notheotherben/git-tool --from gh:SierraSoftworks/git-tool
gt new gh:notheotherben/git-tool --fork gh:SierraSoftworks/git-tool
When --from/--fork is provided, Git-Tool should:
- Use
GitClone { ... } to clone the --from repo into the desired destination path (instead of using GitInit { ... }).
- Attempt to perform a fork/template instantiation using the GitHub API (instead of creating a new repo).
- Update the
origin URL to point at the correct repository (using GitRemote { ... }).
- Add a new
upstream remote pointing at the --from/--fork repository to enable fetching.
Describe alternatives you've considered
We also considered a new gt fork command which would create a fork of a specific repository, however this requires a user to learn a new command and would (if we deferred cloning until after the fork was completed) require polling for completion of an async GitHub operation, increasing complexity.
Is your feature request related to a problem? Please describe.
When creating new repositories, I would like to be able to specify that the repository is seeded from an initial repository (either a fork, or a template, in GitHub nomenclature). This action should, when working against GitHub repos, automatically create the appropriate fork/template instance instead of creating a new (unlinked) repo, enabling the "GitHub Flow" contribution workflow.
Describe the solution you'd like
I'd like to be able to provide a
--from/--forkargument when runninggt new, specifying a source repository from which the new repo should be seeded.When
--from/--forkis provided, Git-Tool should:GitClone { ... }to clone the--fromrepo into the desired destination path (instead of usingGitInit { ... }).originURL to point at the correct repository (usingGitRemote { ... }).upstreamremote pointing at the--from/--forkrepository to enable fetching.Describe alternatives you've considered
We also considered a new
gt forkcommand which would create a fork of a specific repository, however this requires a user to learn a new command and would (if we deferred cloning until after the fork was completed) require polling for completion of an async GitHub operation, increasing complexity.