We're using Git to synchronize our servers (dev and live) with our development machines. Developers upload via SFTP to the dev server to test features and changes. Then, when everything is finished it is committed and finally pulled into the Git repository.
The problem is that
git commit -a -m 'Message' # on local machine
git push origin master # on local machine
git pull origin master # on server
on the server almost always won't simply merge files, delete or ignore untracked ones. It thinks there are changes and advices to commit them but of course we don't want to! For example after the below cleanup and reset steps there remain two untracked folders which we shall add?!
We tried
git reset --hard HEAD
git clean -f
git fetch
And read through many git guides. But it does not work as it did with
svn up --force
I was adviced to sync the servers from time to time as there could be inconsistencies from failed uploads etc. What's wrong? Can't we work using Git this way? It's to much work to clean up the servers directories all the time.
Edit: I should add that we can't test locally as the web application depencs strongly on the domain and needs a complex setup (Solr).
Would this be better via NFS share instead of FTP?