Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

hjortur17's avatar

Unable to deploy to server

Hi, so I'm uploading my files to GitHub and Laravel Forge picks that up and works with it to display my website. But for some reasons, Laravel Forge is Unable to deploy to server, and when I try to git push, it says Already up to date. Does the same when I try to git pull. Can anyone help me with this one?

Here is the error message from the Laravel Forge dashboard:

Tue Oct 23 14:09:56 UTC 2018
From github.com:hjortur17/nfs
 * branch            master     -> FETCH_HEAD
error: Your local changes to the following files would be overwritten by merge:
    package-lock.json
    package.json
    public/css/app.css
    public/js/app.js
    resources/js/bootstrap.js
Please, commit your changes or stash them before you can merge.
Aborting
Updating 90d1692..325c61b

Thanks again!

0 likes
17 replies
petritr's avatar

@HJORTUR17 you need to commit your changes before you push, looks like you have some changes that are not committed.

1 like
hjortur17's avatar

Done that, I do always do:

git add . git commit -m "message" git push

hjortur17's avatar

I get this when I commit:

On branch master Your branch is up to date with 'origin/master'. nothing to commit, working tree clean

petritr's avatar

What do you see when you do git status ? Do you have other branches except master ? Did you change something in other branches ?

1 like
hjortur17's avatar

This is the reply from git status

On branch master Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

petritr's avatar

Do you have other branches except master ? Did you change something in other branches ?

petritr's avatar

Have you run before npm ? Can you run it again npm run watch then check git status ?

hjortur17's avatar

This what I get:

Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory)

modified:   public/css/app.css
modified:   public/js/app.js

no changes added to commit (use "git add" and/or "git commit -a")

petritr's avatar

What happens when you add them git add . ?

hjortur17's avatar

I can upload it, no problem, but still, Laravel Forge says We were unable to deploy to server

petritr's avatar

When you push you will see the same error right ? git push origin ....

petritr's avatar

When you try to push you get again the error above from you question ? Please, commit your changes or stash them before you can merge. Aborting

hjortur17's avatar
hjortur17
OP
Best Answer
Level 14

I found a way. I SSH into the server and did git checkout . and it worked.

Please or to participate in this conversation.