I have issue with forge deployment which I cant fix. When I load domain it is working fine but when i deploy any change I got this error :
branch master -> FETCH_HEAD
error: Your local changes to the following files would be overwritten by merge:
app/Category.php
Please, commit your changes or stash them before you can merge.
Aborting
Updating b16e664..15a9a7d
Couldn't SSH Into Server?
Please make sure that the following SSH key is placed in both the /home/forge/.ssh/authorized_keys file and the /root/.ssh/authorized_keys file on your server.
but I dont have any issue with ssh.. I can login with ssh with no issues.. I can fix it by removing the domain and add it again.. but it will fail for next changes,,
Well the error says that you changed the Category.php file on the server. Never ever ever change files on your server when you have deploy script. It will break the flow. I guess you put your changes in your commits now anyway.
To solve this you need to revert the changes you made on the server. You can simply ssh into your server and go to your project. Then run the following command.
// Go back to the original branch since last deployment
git checkout .
You can now deploy again since you removed all the changes on the server.
Yeah that is what I mean. Otherwise you have two versions running. Your local version that is connected to git and the one that is deployed based on git. If you change the one on the server git won't know what version to use.
Make changes locally on your Mac, push those changes to GitHub then have Forge pull in those changes. You should never SSH into your droplet and make manual changes to files that are part of your repository.
You can change it on Github, I believe it will create a separate commit for you. If that isn't the case you shouldn't be changing code there. You should run your code locally and see if everything works. If everything works you can push it to the server ;)