Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git-gitignore文件的添加 #20

Open
jeffrey1995 opened this issue Oct 26, 2016 · 0 comments
Open

Git-gitignore文件的添加 #20

jeffrey1995 opened this issue Oct 26, 2016 · 0 comments

Comments

@jeffrey1995
Copy link
Owner

说明:

.gitignore文件是使用git版本控制器时,在本地仓库的工作空间下的一个配置文件,顾名思义,在这个文件声明的文件,当这些文件发生改动时,git追踪器不会提醒我们这些改动。
好处:拿Android开发为例,开发时,我们通常只对app下一些文件做了改动或者说我们只关注这些改动,而编译器自动产生的一些配置文件和编译时产生的文件我们是不需要commit的,如果没有设置.gitignore文件,每次提交前都会有这些文件的提醒,不仅看着乱,而且没有什么用。
添加方法:在本地仓库的工作空间下创建一个.gitignore文件,文件的配置内容参考:https://github.com/github/gitignore
这里面有各种工程类型的.gitignore的标准配置,可以参考配置自己的.gitignore。

添加后生效方法:

1.首先移除所有的缓存索引
git rm -r --cached .
2.添加所有文件
git add .
搞定!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant