Laravel Forge、Git、Bitbucket和部署到Digitalocean
我已将我的网站部署到DigitalOcean droplet。现在,我在本地做了一些更改,推到了我的Bitbucket repo,当我登录Forge并单击Deploy时,我收到以下消息:Laravel Forge、Git、Bitbucket和部署到Digitalocean,git,bitbucket,laravel-5.2,digital-ocean,laravel-forge,Git,Bitbucket,Laravel 5.2,Digital Ocean,Laravel Forge,我已将我的网站部署到DigitalOcean droplet。现在,我在本地做了一些更改,推到了我的Bitbucket repo,当我登录Forge并单击Deploy时,我收到以下消息: From bitbucket.org:myUsername/myBucket * branch master -> FETCH_HEAD error: Your local changes to the following files would be overwritte
From bitbucket.org:myUsername/myBucket
* branch master -> FETCH_HEAD
error: Your local changes to the following files would be overwritten by merge:
app/Http/Controllers/MyController.php
Please, commit your changes or stash them before you can merge.
Aborting
所以如果我做对了,他不会在我的液滴上更新MyController,因为它会被覆盖?这不是部署的重点吗
很明显,我这里有点不对劲,所以非常感谢您的帮助
这是我的部署脚本:
cd /home/forge/mysite.com
git pull origin master
composer install --no-interaction --no-dev --prefer-dist
php artisan migrate --force --seed
php artisan migrate --path=vendor/mpociot/versionable/src/migrations
通过SSH进入服务器并运行
git stash
然后git pull
解决。我认为应该将git stash
添加到部署脚本中,但问题是我看不出有任何理由将旧文件隐藏在live server上。等待建议,谢谢。看起来您已经在服务器上编辑了app/Http/Controllers/MyController.php
。现在,在提交中,您尝试提取的同一文件已更改。因此,它现在发出的信息是,您所做的更改将被覆盖。将来,您可以通过在服务器上运行git status
和git diff
来检查它,然后决定是否确实需要这些更改。