Git Tools
-
The wordpress.com pricing page mentions this feature: ‘SFTP/SSH, WP-CLI, Git tools’. What, specifically, are the git tools that are available?
I have a deep understanding of Git. I’ve been using it daily for decades. I’m curious what tools and integrations are available.
Also, to use Git with wordpress.com hosting, do I need to track the entire project? Just the wp-content directory? Just the theme? If tracking the entire project, what’s the recommended way to handle WP core updates?
Thanks!
WP.com: Yes
Jetpack: No
Correct account: YesThe blog I need help with is: (visible only to logged in users)
-
Hello there,
Each site with a Business or Commerce Plan comes with Git 2.30.2 and includes all Git commands.
You could use Git to manage file versions on the site, but we manage core updates and updates for a few plugins and themes.
Were you considering creating a new site or moving an existing one here? And if you’d like to share the main purpose of the site, as well as any essential functions or features it will require, we can offer more personalized recommendations.
If you also plan on selling products on the site or need extensive eCommerce functionality, you could consider the Commerce Plan. If not, the Business Plan will also give you access to SFTP/SSH, WP-CLI, Git tools, and much more.
Also, all annual plans come with a 14-day refund window, so you’d have time to see if WordPress.com would be the right fit for what you want to do.
And if you ever need more detailed knowledge about how plugins and themes work on WordPress.com, you can also check with our developers:
https://wordpress.com/support/developers/Please feel free to reply to this message if you have any other questions and have a great day!
-
What does the workflow look like when using Git? Here’s some specific questions:
- Do I track the entire project? For example, the git repository is initialized in the root wordpress directory, and use .gitignore to not track wp core files/folders
- Or do I only track my specific theme/plugin? For example, the git repository is initialized in wp-content/themes/my-theme
- What are the deployment options? I saw this article, but it does not mention how the project should be setup (see above two questions). Is this the only way to deploy using Git?
- What’s the suggested workflow to deploy when you have multiple environments?
Thanks!
-
@jfester, we’ll check on that for you and let you know what we find.
Can you clarify this part?
What’s the suggested workflow to deploy when you have multiple environments?
Will you be running multiple WordPress.com sites, or a mix of .com and .org instances, or what do you have in mind?
-
Thanks @supernovia
I’m looking for an overall picture of all the steps required to go from local to staging to production.
Let’s say I’ve added a staging site. I’ve made some updates locally that I’m ready to push to staging. I’ll probably want to pull data down from production to staging first. Is that possible? Next, I do some form of git-based deployment (depending on answers to previous questions). From there, could I push code + data to production from staging? Do I also have the option to run a separate git-based deployment to production, and push data (no code) from staging to production?
-
Hi @jfester
To preface, the Deploy From GitHub Workflow is a feature that is still being refined and it does not include all the functionality that you are looking for. This workflow is intended to allow you to deploy changes primarily to themes, plugins, and other custom extensions. It is not intended for you to deploy or sync site data nor to sync changes between WordPress.com hosted staging and production sites.
To use this workflow as is, you would need to initialize in
/htdocsand then upload your desired files mirroring the standard WordPress structure (i.ehtdocs/wp-content/themes/my-theme). Alternatively, you could modify theftp-serverparameter when configuring the workflow so that the base for a new deploy is different.In this case it should start with
sftp://sftp.wp.com/htdocsbut fromhtdocsyou can choose any path they want. To compare with the above example, it’d besftp://sftp.wp.com/htdocs/wp-content/themesand themy-themefolder would be copied over on a new commit. Please note, whatever path you define must exist before the deployment, otherwise it will fail the job.With this workflow, you should not need to worry about ignoring core or symlinked files as the deployment will only patch the existing installation. If you plan to use the repo only for WordPress.com sites, you should be able to leave out core and symlinked files entirely if you wish.
As for your question about multiple environments:
If you want to deploy the same code to different sites you could call the action multiple times in the same workflow with different parameters. Or, if you want to deploy code to a staging site the procedure would be the same as the production site, but you would use the credentials for the staging site from the Hosting Configuration page.
To handle the original data syncing we do have a feature that allows you to Create a Staging Site that will essentially clone your existing live site but it does not currently include any sort of functionality to sync back to the live site (either data or code). This ability is something we are working on though. Presently our recommendation for this sync is manual and typically involves creating and downloading a backup of the staging site which is then restored to the live site. Through a combination of Github and SSH access this is theoretically something that could be scripted and built into a workflow but it would be custom and would fall outside our scope of support.
Hopefully this answers your questions but if something is still unclear or you have other questions, please let us know.
- The topic ‘Git Tools’ is closed to new replies.