origin
deploy
(bare repo on bluehost that has a hook to push to www folder for all to see site)
So, workflow would be like this since I work at two different locations:
origin
(github)
deploy
(bluehost)
Still with me?
This has worked for some time and for me it's awesome
Then I pissed in the pool
I accidentally ftp'd files to bluehost (sublime sftp was enabled), now when I try to push deploy
the latest and greatest to bluehost I get the error that everything is up to date and if I make some changes, do a new commit
then push, I get the error such and such file will be overwritten with merge, commit or stash ...
The local repo and the git repo are all in check, it's the bluehost one that is messed up.
Please help me fix this. I have tried googling this and reading other posts here but everything seems to not solve my problem. I tried push --force
but to no avail.
Any ideas would be great. Or should I just erase the whole bluehost folder and start over with a brand new git repo to get things copacetic again?
EDIT: out put from git
C:\xampp\htdocs\www\testingboard>git status
# On branch master
nothing to commit, working directory clean
C:\xampp\htdocs\www\testingboard>git push deploy master
[email protected]'s password:
Everything up-to-date
C:\xampp\htdocs\www\testingboard>git add -A
C:\xampp\htdocs\www\testingboard>git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: index.php
#
C:\xampp\htdocs\www\testingboard>git commit -m "added mobile variable to index.p
hp"
[master e0be437] added mobile bariable to index.php
1 file changed, 5 insertions(+)
C:\xampp\htdocs\www\testingboard>git push origin master
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 353 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
To https://github.com/danferth/breadBoard.git
9e9f3c1..e0be437 master -> master
C:\xampp\htdocs\www\testingboard>git push deploy master
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 353 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: From /home4/danferth/git/breadboard
remote: 9e9f3c1..e0be437 master -> origin/master
remote: error: Your local changes to the following files would be overwritten by
merge:
remote: .sass-cache/6329d896b0dd00f287815f75641600307d9f0023/css_didI.sc
ssc
remote: _START/pageTitle.php
remote: assets/custom_css/css_didI.css
remote: assets/custom_css/css_didI.scss
remote: content/p_didI.php
remote: didI.php
remote: index.php
remote: template.php
remote: Please, commit your changes or stash them before you can merge.
remote: Aborting
remote: Updating 0dc9e3d..e0be437
To [email protected]:~/git/breadboard.git
9e9f3c1..e0be437 master -> master
C:\xampp\htdocs\www\testingboard>
On the deploy server, use shell access and go to the www folder (the git repo checkout). Then use git status
to get a list of files that are not in sync. Then use git checkout -- <paths>
to restore those files from the git repo, so they're back in sync. Then you should be able to git pull
on the server, or just git push deploy
your local changes.
Since you're using a post-commit hook, the changes are already present in the bare repo on the deploy server but just not yet in the checked out www location. So a git pull
there should get your webserver up to date.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With