博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
git 初始化git存储库_什么不保存到Git存储库中
阅读量:2519 次
发布时间:2019-05-11

本文共 2541 字,大约阅读时间需要 8 分钟。

git 初始化git存储库

You should not commit these four types of files into your Git repository.

您不应将这四种类型的文件提交到Git存储库中。

  1. Files that don’t belong to the project

    不属于项目的文件
  2. Files that are automatically generated

    自动生成的文件
  3. Libraries (depends on the situation)

    图书馆(视情况而定)
  4. Credentials

    证书

不属于项目的文件 (Files that don’t belong to the project)

Files like .DS_Store (for Mac OS), Thumds.db (for Windows), .vscode (for code editors) have nothing to do with your project.

.DS_Store (对于Mac OS), Thumds.db (对于Windows) .vscode (对于代码编辑器)等文件与您的项目无关。

They should not be checked in.

他们不应该签入。

自动生成的文件 (Files that are automatically generated)

This includes files from preprocessors (like Sass to CSS). You don’t check in the CSS. You check in the Sass files.

这包括来自预处理器的文件(例如Sass到CSS)。 您无需签入CSS。 您签入Sass文件。

If you use JavaScript compilers like Webpack or Rollup, you don’t check in the generated JavaScript file. You check in the code you write.

如果使用Webpack或Rollup之类JavaScript编译器,则不要签入生成JavaScript文件。 您检入编写的代码。

图书馆 (Libraries)

If you don’t use a package manager, you should check in your libraries. This is because if you want to download the library, you have to:

如果您不使用包管理器,则应签入库。 这是因为如果要下载该库,则必须:

  1. Google for the library

    Google图书馆
  2. Get to the website

    进入网站
  3. Find the link

    查找链接
  4. Download the library

    下载资料库
  5. Put into your project

    放入您的项目

This process is tedious. If your code needs the library to work, you should check in the library.

这个过程很繁琐。 如果您的代码需要库运行,则应签入库。

On the other hand, if you use a package manager, you shouldn’t check in a library because you can install the library with a single command like npm install.

另一方面,如果使用软件包管理器,则不应签入库,因为可以使用单个命令(如npm install

证书 (Credentials)

You shouldn’t store credentials like usernames, passwords, API keys and API secrets.

您不应存储用户名,密码,API密钥和API机密之类的凭据。

If someone else steals your credentials, they can do nasty things with it. I almost lost $40,00 to $60,000 because a friend accidentally exposed my amazon credentials. Luckily, the amount was waived.

如果其他人窃取了您的凭据,则他们可以用它来处理令人讨厌的事情。 我几乎损失了$ 40,00到$ 60,000,因为一个朋友不小心暴露了我的亚马逊凭据。 幸运的是,该金额被免除。

If you don’t want to get into sticky situations like I did, then don’t store your credentials in a Git repository.

如果您不想像我那样陷入困境,那么不要将您的凭据存储在Git存储库中。

Thanks for reading. Did this article help you in any way? If you did, . You might help someone out. Thank you!

谢谢阅读。 本文对您有任何帮助吗? 如果这样做, 。 您可能会帮助某人。 谢谢!

This article was originally posted at .Sign up for my if you want more articles to help you become a better frontend developer.

本文最初发布在 如果您想获得更多文章来帮助您成为更好的前端开发人员,请注册我的 。

翻译自:

git 初始化git存储库

转载地址:http://zbewd.baihongyu.com/

你可能感兴趣的文章
Alpha 冲刺 (7/10)
查看>>
一款jQuery打造的具有多功能切换的幻灯片特效
查看>>
SNMP从入门到开发:进阶篇
查看>>
@ServletComponentScan ,@ComponentScan,@Configuration 解析
查看>>
unity3d 射弹基础案例代码分析
查看>>
thinksns 分页数据
查看>>
os模块
查看>>
最短路径(SP)问题相关算法与模板
查看>>
js算法之最常用的排序
查看>>
Python——交互式图形编程
查看>>
经典排序——希尔排序
查看>>
团队编程项目作业2-团队编程项目代码设计规范
查看>>
英特尔公司将停止910GL、915GL和915PL芯片组的生产
查看>>
Maven配置
查看>>
HttpServletRequest /HttpServletResponse
查看>>
SAM4E单片机之旅——24、使用DSP库求向量数量积
查看>>
从远程库克隆库
查看>>
codeforces Unusual Product
查看>>
hdu4348 - To the moon 可持久化线段树 区间修改 离线处理
查看>>
正则表达式的搜索和替换
查看>>