Loading...


Related Products


Date Published: February 6, 2025

Adding an executable script and its folder to a site's Git repository

Situation

This transcript shows how to add a directory containing an executable to a site's Git repository. In this example, the add-on is in a directory called the_add_on and the file that will be marked executable in the Git repository is the_add_on/connector.php:

$ git checkout tag_on_prod -b myhotfix

$ cp -r ~/Downloads/the_add_on/the_add_on .

$ git add the_add_on/

$ git ls-files --stage the_add_on/
100644 bbb458a7243f906c2175ae97aceb29df519394f6 0   the_add_on/.htaccess
100644 a8ae2efe8f8be133a9099974661c3272987f9092 0   the_add_on/connector.php
100644 fcb5d272a86e08924bd8b19b20b877e03e8bd562 0  the_add_on/readme.html

$ git update-index --chmod=+x the_add_on/connector.php

$ git ls-files --stage the_add_on/
100644 bbb458a7243f906c2175ae97aceb29df519394f6 0   the_add_on/.htaccess
100755 a8ae2efe8f8be133a9099974661c3272987f9092 0   the_add_on/connector.php
100644 fcb5d272a86e08924bd8b19b20b877e03e8bd562 0   the_add_on/readme.html

$ git commit -m "Adding the_add_on directory to docroot"
[myhotfix 677beee7] Adding the_add_on directory to docroot
 3 files changed, 3622 insertions(+)
 create mode 100644 docroot/the_add_on/.htaccess
 create mode 100755 docroot/the_add_on/connector.php
 create mode 100644 docroot/the_add_on/readme.html

$ git push -u origin myhotfix
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 4 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 22.97 KiB | 7.66 MiB/s, done.
Total 7 (delta 2), reused 3 (delta 0)
To svn-1234.devcloud.hosting.acquia.com:theclient.git
 * [new branch]        myhotfix-> myhotfix
Branch 'myhotfix' set up to track remote branch 'myhotfix' from 'origin'.
$

Did not find what you were looking for?

If this content did not answer your questions, try searching or contacting our support team for further assistance.

Back to Section navigation