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

Respect's avatar

git pull in laravel app in cpanel updated commit but does not update files

git pull in laravel app in cpanel updated commit but does not update files

  • in local
git push origin master
  • in cpanel ssh
git pull origin master
  • in cpanel ssh git log show updated commit but files not updated
0 likes
28 replies
gych's avatar

Did you also build your application with npm run build after pulling?

1 like
Respect's avatar

@gych not using npm just editing any file app.blade.php css any type of files not update remove caches with all commands php artisan config:clear php artisan cache:clear php artisan route:clear php artisan view:clear php artisan optimize:clear

but steel not effected and commit updated bit files not

gych's avatar

@Respect Your application needs to be builded when deploying to your host. Otherwise some changes might not be visible after you just pull the latest changes.

You can either build locally or build via ssh. Just make sure you update the build folder in your public root after pulling new changes.

In the future it might be interesting for you to look into creating a deploy script. Once you learn this you can deploy via command line or even via a CD/CI pipeline with a bit more experience.

1 like
Respect's avatar

@gych thanks for answer but can not find any build folder in public folder

gych's avatar

@Respect Did you use the command npm run build in the terminal?

1 like
Respect's avatar

@gych no bro i'm using just composer install by ssh connection and i dont know why git pull not update files

gych's avatar

@Respect You'll also have to run npm run build in order to build your assets like css files for example. This will add the builded assets in the folder your_laravel_app/public/build

How did you set up the host environmen, what is currently the public root? Did you move the contents from your_laravel_app/public manually to the public root?

1 like
Respect's avatar

@gych no man net using npm or any packages throw npm , it was working 100% but git pull stop updagting files but commit updated if i run git log find commit updated but code or files not updated

gych's avatar

@Respect If you check the files that should be updated on your server, do they contain the changes you've pulled?

1 like
Respect's avatar

@gych no they did not -- i dont know what -- cleared all caches but steel not effected NOTE : as i mentioned above git log show updated commit

Respect's avatar

@gych i'm thinking to delete .git and reinit again -- but i do not know how what steps to continue working not conflict when run git pull --- because if i re init git i think will deal with server files as new state i'm not sure

gych's avatar

@Respect Strange...

Try to run git reset --hard HEAD via cPanel ssh, this will reset your repository of your host to the head of your remote git repository.

Did this work before or is it the first time you're pulling new changes on that host?

1 like
Respect's avatar

thanks bro for answer , no not first time i pulled 95% of work ,for more 15 days of work and it was working without problems - untill faced this problem , what command steps exatly should i use to can continue working

Respect's avatar

@gych git reset --hard HEAD ONLY -- after i delete .git folder ? Does these steps correct ? 1 - remove .git folder 2 - git init again 3 - git remote add origin repo_url 4 - git reset --hard HEAD ( will fetch the changes from remote to server local and let me continue as usual )

gych's avatar

@Respect No you don't have to delete the folder first to run this command. Just run it before trying anything else it will reset the cloned repo on your host to its current remote head (the latest commit on the current checked out branch)

1 like
Respect's avatar

@gych Thanks for answer when i used git remote add & git pull -- not git clone when i used the repo does it will do any diffrance

Respect's avatar

@gych thanks for answer , no bro steel pull not effect in files but effects in git log commit only

gych's avatar
gych
Best Answer
Level 29

@Respect Run git status command what does it show you ?

Did you already try to run git reset --hard HEAD ?

gych's avatar

Did you already got it working again?

1 like
Respect's avatar

@gych TAHNK YOU SO SO SO MUCH , for you time and help I made same history scenario localy and it's worked Thanks so much ,

1 like
Snapey's avatar

your server may be using opcache or phpfpm which will keep the state of the previous files

as a first step, find a file that you have modified and check the file in the filesystem. Dont just rely on whether the web page reflects the change

1 like
Respect's avatar

@Snapey thanks for answer , i checked files code not effected by new code which i pushed -- , but git log commit updated , For example ) 1 - Edited contact form in contact page - git push with commit ="Add phone to connect form" 2 - i hostinger server (ssh) - git pull , contact page not updated yet (BUT) 3- git log command in server - show me latest updated commit like Add phone to connect form" 1 second ago Used all laravel command and to clear cache and things like that , steel problem not solved 4 - again and again edit - push - pull - commits updated - but files not

Respect's avatar

@Snapey no bro thanks for answer , no bro push to master * pull from master

andreigirnet96's avatar

Clear cache and hard reload your page. You can try from chrome inspect->rightclick on refresh-button->hard reload and clear cache. Most of the time changes don't take place because of cache on live server.

Also make sure that git pull actually fetches the code from git successfully.

Please or to participate in this conversation.