我在我的项目中使用Git作为版本控制工具。在开发环境中一切正常,但是,当我部署时,每次我被要求提交/存储更改。
remote: Counting objects: 20, done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 20 (delta 15), reused 0 (delta 0)
Unpacking objects: 100% (20/20), done.
From https://bitbucket.org/myaccount/myproject
* branch HEAD -> FETCH_HEAD
Updating 14b5cbd..7092c02
error: Your local changes to the following files would be overwritten by merge:
app/Http/Controllers/UserController.php
Please, commit your changes or stash them before you can merge.
Aborting
我正在使用以下命令来获取更改:
sudo git pull https://myuser@bitbucket.org/myaccount/myproject.git
所以,每当我需要sudo git stash
并再次拉动时。
我认为这是因为我需要在每次拉取后更改某些目录的权限,但我不确定它是否是问题的根源。
无论如何,这似乎不对。如何在不需要执行此操作的情况下提取生产服务器中的更改?
答案 0 :(得分:1)
git跟踪文件权限的更改。
您可以更改文件的权限并一劳永逸地提交。