L
L
Leonid2018-12-07 13:26:22
git
Leonid, 2018-12-07 13:26:22

How to safely update site files that have been modified outside of Git to the latest revision?

It just so happened that a working site is deployed on the server, in the form of a working copy of the project from Git.
Updating is done via git pull
For a long time, site file updates have been done by simply replacing files via FTP.
In parallel, 8 revisions (updates) were made in Git.
Which command can be used to see all files on the server that do not match the Git working copy - i.e. have been replaced?
What is the safest way to update the working copy on the server to the latest revision?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri, 2018-12-07
@easycode

git status - you will see all changed files
You can also do something like this:
do git stash - and you will "hide" all those files that were directly uploaded via FTP, and you will have the latest up-to-date version in the repository
Then you can do git pull - update to the most recent version from the repository
Then git stash apply - restore those files that were hidden
Well, then look. If there are conflicts, resolve them. If they are not there, then just add them to the index and make a commit.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question