Frage

I have been reading up on Git lately a lot and now I have tried to incorporate all of that stuff into my workflow. Basically everything is working but I have a weired behaviour which I can't explain nor get my head around it really. I have searched the internet up and down for this problem but since Git give's you so much freedom to which moving parts to use or to not use I find it hard to find an answer to my specific situation.

So, here is my setup/my steps that I have accomplished so far:

  • In the beginning I had an already running website (running EE as CMS). I'll refer to this as PROD. I reconfigured some files and paths and stuff to make everything flexible to have this instance running on different servers/enviroments via config files, relative paths and so on
  • Then I added .gitignore file and configured to my needs (eg. excluding cache folders)
  • Initialized git
  • Pushed this repo to Bitbucket (I'll refer this as BB).
  • Cloned the repo to local. I'll refer to this as DEV.
  • Then I configured the service FTPloy to handle deploys whenever I push from DEV to BB.
  • Then I made changes to two files in DEV
  • Commited the changes and pushed to BB
  • Those changes are then also reflected on PROD

So, all fine until here. Now comes the weird part/the part I don't get:

When I ssh into PROD after doing the above steps and running "git status" I get this:

# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   public_html/assets/templates/default_site/blog.group/_entry.html
#   modified:   public_html/assets/templates/default_site/blog.group/index.html

Those two modified files are the ones I just pushed from DEV so it seems kinda logical to me but then again at the same time totally not. It seems like I created an endless loop or something.

Does anybody spot the mistake that I have made in my setup or knows how to fix this?

Thanks!

War es hilfreich?

Lösung 2

I ended up contacting FTPloy as I assumed that my problem might have something to do with the way FTPloy works. Here is what they said:

Git shouldn’t be initialised on your server if you’re deploying with FTPloy as we don’t have access to the .git directory on Bitbucket and only deploy your actual code. There are numerous security risks with deploying the .git directory so I won’t get into those now.

So, I'll remove the .git folder from my Production server and rsync Assets like user uploaded images to my local repo once in a while.

Andere Tipps

Could it be that you did not use "git add" after modifying your files ? In contrast with other cvs's if you modify a file it isn't staged. The work flow would be to edit a file, use git add to stage it, git commit and then push. Otherwise your changes won't be pushed. You could also check it in your dev env if you run there "git status"

See Git Pro Book

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top