Drush Make removes .git folders
-
16-10-2019 - |
Question
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!
Solution
Pass the "--working-copy" switch to Drush Make.
drush make --working-copy site.make
OTHER TIPS
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
.
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