afragen / git-updater

This WP plugin will update GitHub, Bitbucket, GitLab, and Gitea hosted plugins and themes
https://git-updater.com
MIT License
3.2k stars 462 forks source link

.git folder deleted on update #594

Closed akforsyt closed 7 years ago

akforsyt commented 7 years ago

I just realized that when I update or change a branch GHU is wiping my .git folder from the directory. I saw that this was your intended behavior in #88. I would like to know if there would be a way to change that: maybe an option in the settings to install with git info?

afragen commented 7 years ago

If you're looking to fork the project you should use a git clone and git rebase to install and then update and not an actual plugin update.

akforsyt commented 7 years ago

I'm just updating a plugin that initially had a .git folder. When I use GHU to update the plugin, the .git folder is deleted. The reason I would like to keep the .git folder really has to do with my workflow.
I start by syncing a copy from production to my local environment using Wordmove. When the plugins are connected to GitHub (ie they contain the git info), I can then branch them, edit them, and commit them to GitHub from my local environment. Then I can test in a dev environment by using GHU to switch to the branch I created. If everything looks good, I merge the branch with master, then update the plugin in prod using GHU. The next time I go to sync from prod to local however, the prod version has lost its connection to GitHub (.git folder), because it has been deleted by GHU. Does that clarify the situation I'm working in? By the way, thanks for the plugin. It saves a lot of FTPing between environments.

afragen commented 7 years ago

Is the .git folder stored in your GitHub repo? Any updated code comes from there. I’m reasonably certain that hidden files/folders aren’t in the download. More to do with GitHub than GHU.

afragen commented 7 years ago

There is no specific code in the plugin that decides which files/folders to keep or remove. Any files/folders that are present in a download of the repository are present after an update.