10

After a silly feeling with drush make and github I found out that all the .git folders (used by git to record history, config, origin location etc ) were removed by drush make and I have heard about this before but didn't come across myself as I was not maintaining the make files.

Specifically drush make removes the .git folder and u can see that if u run it with --debug option

Executing: rm -rf '/tmp/drush_make_tmp_1305733094/__git__/__build__/.git'

In my make file I am fetching 4 things from git repo because I wish to track development on them, 2 of them are my custom components ( 1 custom module and 1 feature which records all the config) and the other drupal core and media module due to high volume of fixes they receive. The whole purpose seems defeated if I can't have respective .git folders but I am also sure there is a way as others are using drush make with git but couldn't find in my quick search.

Thanks for your time!

16

Pass the "--working-copy" switch to Drush Make.

drush make --working-copy site.make
  • 5
    If you'd like per-project control over this, you can add to the make file: projects[project_name][options][working-copy] = TRUE – Andy Oct 23 '13 at 12:18
6

And if you're using YAML for your make file, the following will allow you to preserve the .git repository info:

projects:

  drupal:
    type: core
    version: 8.0.x
    download:
      working-copy: true

And further, if you don't want drush to add in extra information to projects' .info files, make sure you use the --no-gitinfofile option when running drush make.

3

On project by project basis, in a make file you can add the option like this

projects[project_name][download][type] = git
projects[project_name][download][url] = ssh://git@...etc
projects[project_name][options][working-copy] = TRUE
  • This is not correct; Andy's comment above actually works. You have to use the options array, not the download array, to fetch the working copy. – Ryan Szrama Jun 9 '16 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.