问题描述
我只想从GitHub隐藏一些git文件.
I just want to hide some of my git file from GitHub.
类似于此回购https://github.com/karlcoelho/undergrad.co
.
Like this repo https://github.com/karlcoelho/undergrad.co
.
是否可以使用.gitignore
或其他任何方式?
Is that possible using .gitignore
or any other way ?
推荐答案
使用.gitignore文件可将文件排除在推送到任何远程程序(如Github)的一部分之外,因此,如果在另一台计算机上克隆该回购协议,这些文件将不会成功. t出现,并且如果您无法访问计算机,则忽略的文件将永久消失,因为它们不是git版本控件的一部分.
Using the .gitignore file excludes files from being part of a push to any remotes such as Github, so if you clone the repo on another machine those files won't appear, and if you lose access to your machine the ignored files are gone for good because they are not part of the git version control.
Github提供高级计划,所有您都将拥有私人存储库.将存储库标记为私有可以使您按正常方式推送和拉出存储库,而不会将它们公开显示.只有您和任何协作者都可以访问存储库.
Github offers premium Plans which all you to have private repositories. Marking a repository as private allows you to push and pull your repositories as normal and not have them in public view. Only you and any collaborators have access to the repository.
有权访问.edu电子邮件地址的学生可以访问Github Student Developer Pack,该软件包为您提供了Developer计划,可以授予无限的私有存储库以及更多内容: https://education.github.com/pack
Students with access to a .edu email address have access to the Github Student Developer Pack which gives you the Developer plan, granting unlimited private repositories and more: https://education.github.com/pack
或者,您可以使用其他允许免费私人存储库的git存储库站点.想到了Gitlab.
Alternatively, you can use other git repository sites which allow free private repositories. Gitlab comes to mind.
这篇关于如何在Github公共上隐藏文件和文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!