简体   繁体   English

Git - 如何添加 gitignore 文件

[英]Git - How to add gitignore files

I am new to git and cloned an existing project.我是 git 的新手并克隆了一个现有项目。 I want to then push that into another repo.然后我想把它推到另一个回购中。 I noticed that some of my files didn't get added to the repo, I assume they are part of the .gitignore file.我注意到我的一些文件没有被添加到 repo 中,我认为它们是.gitignore文件的一部分。 I was just wondering, how can I add everything including the skipped files?我只是想知道,如何添加包括跳过的文件在内的所有内容? Thanks.谢谢。

Or what exactly I need to do so they can be added.或者我到底需要做什么才能添加它们。

If things are being git ignored - there should be a file within your project called .gitignore - open this and there should be a list of git ignored files - you can either delete file names from the list that you want to commit, or you can use an exclamation mark before the file name to efectively say "don't git ignore this file" example如果某些事情被 git 忽略——你的项目中应该有一个名为 .gitignore 的文件——打开它,应该有一个 git 忽略文件的列表——你可以从要提交的列表中删除文件名,或者你可以在文件名前使用感叹号有效地说“不要 git 忽略此文件”示例

/bootstrap/compiled.php
/vendor
composer.phar
.DS_Store
!.idea //this wouldn't be git ignored
.env

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM