在Github上公开分享私人回购的一部分 [英] Share publically a part of a private repo on Github
问题描述
我想知道在Github上公开共享私人存储库中的文件的最佳方法是什么。
I'm wondering what's the best way to publically share on Github a file that's on a private repo on Github.
我想每次在我的私有存储库中自动推送文件时也进行更新。
I would like thet every time a make a push in my private repository automatically the file is updated too.
特别是我有一个.tex项目:我想对tex文件保密,但我想向所有人公开pdf文件。
In particular I have a .tex project: I would like to keep secret the tex files but I would like to make available to everyone the pdf file.
注意,我知道gitignore选项的存在,但是我不想使用它,因为我想跟踪tex文件的改进
Note I'm aware of the existence of the gitignore option, but I don't want to use it since I want to keep track of the improvements on the tex files
推荐答案
我想对tex文件保密,但我想向所有人公开pdf文件。
I would like to keep secret the tex files but I would like to make available to everyone the pdf file.
您可以指定一个公共存储库(其中包含一个简单的 README
)以上传并关联到表示,以 GitHUb版本 形式回购了人工制品(您的pdf)。
You can dedicate a public repo (with a simple README
in it) in order to upload and associate to said public repo an artifact (your pdf) as a GitHUb release.
添加该公共存储库作为私人存储库的子模块 :它将创建一个包含自述文件的子文件夹,并进行说明在哪里可以找到pdf文件(在公共仓库的发行版中)
Add that public repo as a submodule of your private repo: that will create a subfolder with the README in it, explaining where to find the pdf (in the release section of the public repo)
然后,您可以从自己的私人仓库中找到
You can then, from your own private repo:
- 更新README(仅用于创建新提交)
- 标记README子模块存储库(以创建将与发行版相关联的标记
- 将pdf上载到与创建的标签相关联的公共仓库版本中。
所有这些步骤都可以使用 GitHub API 编写脚本:这是一个 bash shell中的示例(集中在版本上传部分)。
All those steps can be scripted, using the GitHub API: here is an example (focused on the release upload part) in bash shell.
这篇关于在Github上公开分享私人回购的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!