Hi copied all my code from pantheon to my local C:/wamp/www and restaured my site in local to find out that git didn´t copy the folder "files" in sites\default\ so any of my files was showing in the site. Apart from no images in my site It causes no color in my theme as well.

It was hours of searching and trying new things to try to bring color and imagenes back until i found out that when i clone my dev site to local with git the files folder is not getting copied.

Anyone knows why is Git not coping the files?

Thanks

Comments

jaypan’s picture

It's not supposed to. The files folder will be unique to each installation.

If you really want to add it, then you need to edit your .gitignore file to remove the reference to the files folder.

Contact me to contract me for D7 -> D10/11 migrations.

TryAgain y veras’s picture

Hi Jaypan,

Thanks for your reply!

I do not know about workflow but if i have 2 sites I will clone that 2 sites to local and each site will be in a different folder in c:/wamp/www and each one need to have each own files folder, ist´s not like that? If i do not have the file folder in my cloned site in local the site doesn´t work.

jaypan’s picture

GIT is for source code. It's actually best not to check binary files (images and .pdfs for example) into GIT, as it is not able to track changes to the file, but rather has to commit the entire file every time a change is made. This bloats the size of your repository and isn't really recommended. The files folder generally will contain binaries, and on top of this, the files in it are linked to your site through values in the database, not through code. So you shouldn't be making the files folder part of your repository.

If you take a copy of the database from one installation and put it on another, then you should also take a copy of the files and put them on the installation into which you inserted the copy of your database. But you should be doing this using a different method than git. You can look at the Backup and Migrate Files module as one solution.

Contact me to contract me for D7 -> D10/11 migrations.

TryAgain y veras’s picture

Thanks for that clarifications Jaypan!

I discover that if i follow next steps the site is working...

  1. use GIT to clone the site in local
  2. use SFTP to download the "Files" folder and place it in local in sites\default\
  3. Use B&M module to export the database from my site and then same module to import the database in my new site

I did all that and my site seems to be working now in local. But i have some new clues. If i want to connect my site with git so when i work in local I can push the changes to an online server. What will happend with the files i need to transfer to the server, should i use FTP? GIT can not transfer that files?

Thank again for your help!

jaypan’s picture

You push them to the server the same way you pulled them to your local server. You can do this using SSH (SFTP) or FTP. You will also need to take a copy of your database (using the B&M module) and upload that on the server as well.

Now that all said, I never actually do that myself. I only ever pull the server database to my local installation. I do this either using the B&M module, or using $drush sql-sync with aliases. I never push my database the other way, as I am always testing on my local server, and I'm likely to open up inconsistencies on my local installation. I don't want to propagate them to the server.

Any settings changes I make on my local installation, I push to the remote server using the Features module. Any content I create on my local installation that I want created on the remote installation, I manually recreate on the remote server.

Contact me to contract me for D7 -> D10/11 migrations.