我将使用Github在本地机器上创建代码的最新副本,我不想发起推送请求,只想发起拉取请求并修改本地机器上的一些文件,并试图让Github忽略某些文件并更新其他文件。
我使用以下命令来忽略名为“config.inc.php”的文件:
我使用以下命令来忽略名为“config.inc.php”的文件:
git rm /home/escogit/www/inc/config.inc.php
然后我对远程github仓库中的其他文件进行了更改,当我尝试使用命令"git pull"获取新更改时,出现以下错误:
remote: Counting objects: 9, done. remote: Compressing objects: 100% (1/1), done. remote: Total 5 (delta 4), reused 5 (delta 4) Unpacking objects: 100% (5/5), done. From github.com:Visooal/Colegios e724ba3..a624059 master -> origin/master Updating e724ba3..a624059 error: Your local changes to the following files would be overwritten by merge: www/inc/config.inc.php Please, commit your changes or stash them before you can merge. Aborting
注意:即使我使用命令git commit -m ".config.inc.php ignored"提交,我仍会遇到该错误。
git rm --cached
。 - Andrew T Finnell