For personal management, it doesn’t matter whether you push it or not. Since you rarely change the configuration file, push 一次和每次都 push there is not much difference.
But if there is a possibility that other people are involved or you may be in multiple bad situations push 时,push 配置文件会带来不必要的冲突,此时你可以 push 一个基本的配置文件,假设配置文件命名为 config,那么第一次推项目的时候,首先把 config 添加到 gitignore ,然后推一个带有基本配置信息的 config_example 文件,push 结束后,同样把 config_example 添加到 gitignore.
Now you can assume that I am going to be involved in your project, so I will first clone 你的项目,把 config_example 文件 pull 下来后,我首先复制一份然后重命名为 config,因为文件里面已经有了基本的配置信息,所以我只需稍微改动适应我的开发环境即可,然后我再将两个文件都添加到 gitignore 中,再 push not affect the remote repository.
This is actually a management method used by our team on our own git server. I think the principles should be similar and I hope it will be helpful to you.
.gitignore will not be used in detail. As for the configuration files in the project, they will generally tell you whether they should be added to version control. For example, the properties file of this Android project says in the comments:
This file is automatically generated by Android Tools.
Do not modify this file -- YOUR CHANGES WILL BE ERASED!
This file must NOT be checked into Version Control Systems,
as it contains information specific to your local configuration.
Must NOT, people have said this, if you still push to the remote git server, your colleagues will strangle you~
Don’t upload these files, because they are actually related to the local usage environment, and other people may not use Eclipse. And the information itself has nothing to do with the project. A good approach is to use tools such as maven to manage the project, and then everyone checkout a clean code locally and generate the files needed to import into the IDE.
For personal management, it doesn’t matter whether you push it or not. Since you rarely change the configuration file,
push
一次和每次都push
there is not much difference.But if there is a possibility that other people are involved or you may be in multiple bad situations
push
时,push
配置文件会带来不必要的冲突,此时你可以push
一个基本的配置文件,假设配置文件命名为config
,那么第一次推项目的时候,首先把config
添加到gitignore
,然后推一个带有基本配置信息的config_example
文件,push
结束后,同样把config_example
添加到gitignore
.Now you can assume that I am going to be involved in your project, so I will first
clone
你的项目,把config_example
文件pull
下来后,我首先复制一份然后重命名为config
,因为文件里面已经有了基本的配置信息,所以我只需稍微改动适应我的开发环境即可,然后我再将两个文件都添加到gitignore
中,再push
not affect the remote repository.This is actually a management method used by our team on our own
git
server. I think the principles should be similar and I hope it will be helpful to you.My experience is, don’t do either. If you use maven to manage your code, just leave pom.xml.
.gitignore will not be used in detail. As for the configuration files in the project, they will generally tell you whether they should be added to version control. For example, the properties file of this Android project says in the comments:
Must NOT, people have said this, if you still push to the remote git server, your colleagues will strangle you~
Don’t upload these files, because they are actually related to the local usage environment, and other people may not use Eclipse. And the information itself has nothing to do with the project. A good approach is to use tools such as maven to manage the project, and then everyone checkout a clean code locally and generate the files needed to import into the IDE.
I just saw a blog post a few days ago - Don’t put configuration files in your Git code repository