Learning Laravel . Out of inexperience, I climbed into the public directory, in which I corrected the files. Then I push
to push my changes to master branch to bitbucket .
After that, I decided to update the server so that the changes appeared on the site, but when update
, an error appeared:
error: Your local changes to the following files would be overwritten by merge: public / js / all.js
Please, commit your changes or stash them before you can merge.
I cannot fix the error and upload updates to the server.
I tried using the git rm --cached public / js / all.js
command to remove my edits from the index to push
again, and then update the server from the repository , but a new error appeared:
Commit failed with error:
On branch master
Your branch is up-to-date with ‘origin / master’.Untracked files:
public / fonts /
public / i /
public / uploads /
public / vendor /
resources / lang / tg / welcome.php
storage / locations.php
storage / profs.phpnothing added to commit but untracked files present
Answer 1, authority 100%
on your server the file has been changed public / js / all.js
You can update the server by commit
, rolling back checkout
, or hiding stash
after which the server will be updated
and similar needs to be added to the .gitignore
exceptions
public / uploads / public / vendor /
Answer 2, authority 93%
You can save changes in the working directory before merging:
git stash save
git merge origin / master
git stash pop