要忽略文件,放到.gitignore 里面,这个我是知道的,只可惜我做晚了,我已经把 data/config.php 文件放到 master 里面了,又 push 到 origin/master里面了,然后悲剧就此开始了。
stackoverflow 上的帖子说: http://stackoverflow.com/questions/1139762/gitignore-file-not-ignoring “ If you are trying to ignore changes to a file that's already tracked in the repository (e.g. a dev.properties file that you would need to change for your local environment but you would never want to check in these changes) than what you want to do is:
git update-index --assume-unchanged ”
可是,我这样做了,再 commit 到本地 master 上,也很赞,说文件 data/config.php 没有变, 可我要去 push 到 origin/master 上的时候,我一 pull,悲剧出现了,说我这个 data/config.php 需要 merge!!!
我怎么才能彻底地让所有人(本地,远程)都彻底忽略这个文件呢?
有谁有这种困扰,快来指点一下把~