0

I have been reading and testing commands from the thread below. None of them have quite solved my problem. How to check for changes on remote (origin) Git repository

Here's my situation:

I have cobbled together bash scripts that use git push & git pull commands, along with wp-cli and rsync in order to moves files back/forth, export/import dbs, and move them between servers.

The scripts work well, I have one last hurdle.

In the scenario of a db import failure, the script will delete any wordpress plugins that have an inactive status, when this happens...

I need a way to inform Git that the files (plugins) it pushed have been deleted on the remote server, so that on the following git push command, all those deleted files are again pushed to the server.

Things that have not worked:

  • git remote update && git status

  • git diff statging(remote)

  • git remote show staging

  • git push origin <your_branch_name> --force

I just get a message stating that Everything up-to-date

Additonal Info:
My remote repo is a bare repo with a work-tree defined via a post-receive containing:

$ cat hooks/post-receive 
#!/bin/bash

#git checkout files from test server [CHANGE VARIABLES]
git --work-tree=/home/username/public_html --git-dir=/home/username/public_html/git/staging.git checkout -f 


#EOF


Any tips for rookie?

B-zaro
  • 205
  • 1
  • 14

0 Answers0