ope*_*ion 5 git bash templates
使用另一个作为模板创建一个新的 repo 是一个很棒的功能,但我只能在 github.com 上看到如何使用此功能。可以完全从命令行完成吗?也许没有遥控器?
我想为用户使用模板来初始化一个 repo 来存储他们的秘密,它甚至可能不需要遥控器,但它没有连接到原始模板 repo 以保护隐私非常重要。提供的 .gitignore 文件和文件夹树是我希望为用户提供这种能力的最重要的功能。
2020 年 6 月:由于像这样的模板存储库是 GitHub 存储库,您可以:
.git文件夹git init .git add .git commit -m "First commit"gh repo creategit push -u origin master这样,一切都是从命令行完成的。
2020 年 9 月更新:通过GitHub CLI 工具gh的另一种方法,并在Ben Gubler的回答中提到,源于来自Mislav Marohni 的PR 1590:“从模板存储库创建存储库” ?和Colin Shum。
(合并在提交 99372f0 中)
gh repo create <new-repo-name> --template="<link-to-template-repo>"
# OR
gh repo create <new-repo-name> --template="<owner/template-repo>"
Run Code Online (Sandbox Code Playgroud)