I have a Drupal 8 installation in a directory called
my-D8. I want to update it to drupal 8.3.1, and I've downloaded
drupal-8.3.1.tar.gz. I have both in my
/d/sites $ ls drupal-8.3.1.tar.gz my-d8/
When I try to extract the archive, it puts everything in a directory called
drupal-8.3.1, which I expected. However, I want all the files and subdirectories of that directory to overwrite (and add to) the existing
I tried the
mv command, but in my shell, it refused to overwrite existing non-empty subdirectories.
$ mv drupal-8.3.1/* my-d8/ mv: cannot move 'drupal-8.3.1/core' to 'my-d8/core': Directory not empty mv: cannot move 'drupal-8.3.1/modules' to 'my-d8/modules': Directory not empty ...
Googling around, I found this AskUbuntu answer, but when I tried it, it didn't quite to the trick:
$ tar -xvf drupal-8.3.1.tar.gz --directory=my-d8 --strip-components=1 drupal-8.3.1/.csslintrc drupal-8.3.1/.editorconfig drupal-8.3.1/.eslintignore ... ^C
Instead of overwriting files in the repo's root, it simply put the subdirectory in the repo:
$ ls my-d8/drupal-8.3.1/ autoload.php composer.json composer.lock core/ README.txt
Edit I tried dope-ghoti's answer, and upon close examination, it didn't work:
$ ls drupal-8.3.1.tar.gz my-D8/ $ tar -zx -f drupal-8.3.1.tar.gz -C my-D8 $ ls my-D8/drupal-8.3.1/ autoload.php composer.json ... $ cd my-D8/ $ git status On branch master Untracked files: (use "git add <file>..." to include in what will be committed) drupal-8.3.1/ nothing added to commit but untracked files present (use "git add" to track)
How can I easily extract the archive files and directories into their respective places in my repository?
$ tar --version tar (GNU tar) 1.29