Development Setup - mavenea/mavencrm GitHub Wiki
- clone the repo
git clone https://github.com/mavenea/mavencrm.git
- switch branch to dev
git branch dev
- during installation a lot of files are created. They are ignored from version control in order to avoid pushing those changes to remotes
### Temp Files###
**/_*
# Installation renamed folder and created file
/*install/
/*install.php.txt
# installed manifest and schema - those are created based on manifest.xml for each module
/modules/*/manifest.xml.installed
/modules/*/schema.xml
# Optional Modules - created during installation if user selected
# NOTE: the optional modules seem to have different handling and so it is ignored at the moment
# THIS means no changes will be pushed for those 2 modules at this stage.
# Once we understand the structure of those, those optional modules ignores should be reviewed.
/modules/CustomerPortal
/modules/RecycleBin
/Smarty/templates/modules/CustomerPortal
/Smarty/templates/modules/RecycleBin
# created during installation
# this module also gets installed and is ignored for time being - however require review if there is intention to modify the module
/modules/ModLightProdAttr
# config files created during installation for Campaigns and SLA modules
/modules/Campaigns/ProcessBounces.config.php
/modules/SLA/SLA.config.php
# User permissions cache files created during installation
/user_privileges/sharing_privileges_1.php
/user_privileges/user_privileges_1.php
### cache dirs ###
# cache created during installation & operation
/cache/sys/vteCacheHV.json
/cache/sys/cacheResouces.json
/cache/vtlib/HTML/*.ser
# cache during operation
/smartoptimizer/cache/*
!/smartoptimizer/cache/index.html
/Smarty/cache/*
!/Smarty/cache/index.html
### Logs ###
logs/*
!logs/.htaccess
# root .htaccess is generated during installation from htaccess.txt file
/.htaccess
##composer modules only on root - assumes to run composer update to generate the vendor directory#
##Note: this will delete vendor directory on next push to remote. You must run `composer install`
/vendor/
# Smart compilation folder files - generated automatially during operation
/Smarty/templates_c/*.php
- Some files and folders are deleted or updated during installation - we should assume those files are not changed or deleted, however, they should still be in version control. If we do not do that, pushing to remote will mistakingly delete those files or directories. Therefore we should tell git to assume those files unchanged.
Edit: see a better solution for all files section ignoring all deleted files
git update-index --add --assume-unchanged config.inc.php
> content is generated during installation, file must exist.empty content to reset.
git update-index --add --assume-unchanged htaccess.txt
> file is deleted during installation and replaced with .htaccess, file must exist.
git update-index --add --assume-unchanged /install
> the whole install directory is deleted when installation is complete. Note: when using this cannot push changes to the install module. revert with git update-index --no-assume-unchanged /install
git update-index --add --assume-unchanged /modules/*/manifest.xml
> every module has a manifest.xml file which gets deleted when installation is complete.
git update-index --add --assume-unchanged /modules/HelpDesk/language/en_us.lang.php
>
git update-index --add --assume-unchanged /modules/HelpDesk/it_it.lang.php
>
git update-index --add --assume-unchanged /cache/vtlib/HTML/README.txt
> deleted when installation is complete.
git update-index --add --assume-unchanged /hash_version.txt
> deleted when installation is complete.
git update-index --add --assume-unchanged /install.php
> deleted when installation is complete.
To verify the list
git ls-files -v | grep '^[[:lower:]]'
- We should delete the same files/folders ignored in our .gitignore. Those are:
/*install/
/*install.php.txt
/modules/*/manifest.xml.installed
/modules/*/schema.xml
/modules/CustomerPortal
/modules/RecycleBin
/Smarty/templates/modules/CustomerPortal
/Smarty/templates/modules/RecycleBin
/modules/ModLightProdAttr
/modules/Campaigns/ProcessBounces.config.php
/modules/SLA/SLA.config.php
/user_privileges/sharing_privileges_1.php
/user_privileges/user_privileges_1.php
/cache/sys/cacheResouces.json
/cache/sys/vteCacheHV.json
/cache/vtlib/HTML/*.ser
/Smarty/templates_c/*
- Rollback the following files/folders from git
/install
/modules/*.manifest.xml
/modules/HelpDesk/language/en_us.lang.php
/modules/HelpDesk/it_it.lang.php
/hash_version.txt
/install.php
- create /
htaccess.txt
file by coping content from /.htaccess
- empty the content of /
config.inc.php
during installation, a lot of files are deleted. If those files are committed to git , the next time you do a pull from the server or try a push it will delete those files. the solution is to ignore those deleted files but still have them in version control. after the installation is complete, the solution to that is to run the following command
for i in `git status | grep deleted | awk '{print $2}'`; do git update-index --assume-unchanged $i; done
In addition the following files must also be assumed unchanged
git update-index --add --assume-unchanged config.inc.php
git update-index --add --assume-unchanged include/utils/VTEProperties # config and sensitive information may be here
git update-index --add --assume-unchanged /modules/HelpDesk/language/en_us.lang.php
git update-index --add --assume-unchanged /modules/HelpDesk/language/it_it.lang.php
git update-index --add --assume-unchanged /cache/vtlib/HTML/README.txt
git update-index --add --assume-unchanged htaccess.txt
To verify the list
git ls-files -v | grep '^[[:lower:]]'
stashing is useful to clean the tree without commit unwanted/sensitive info and push to remotes. VTEProperties.php
for example.
when pushing to specific remotes , you can
stash apply <mystashref>
# will pop the stash but keep the stash intact
stash pop <mystashref>
# will pop the stash and remove the stash - dont do that unless you dont want the stash!
https://mijingo.com/blog/saving-changes-with-git-stash
removing all history of git https://stackoverflow.com/questions/13716658/how-to-delete-all-commit-history-in-github