L
L
Leonid2017-09-15 23:16:55
git
Leonid, 2017-09-15 23:16:55

How to update the code of a WordPress site from a Git repository on shared hosting?

Task:
- upload the WordPress site code from the TimeWeb virtual hosting to the bitbucket.org repository with the possibility of subsequent code updates in both directions: from the hosting site folder to the bitbucket.org repository and vice versa!
What I did:
1) Created a repository on bitbucket.org
2) SSHed into TimeWeb hosting and ran the following commands to get started:

cd mysite.ru/public_html
git init
git config --global user.name "John Doe"
git config --global user.email [email protected]

What I need to do is:
1) create a .gitignore in order to set the rules for ignoring WordPress folders:
wp-content/upgrade
wp-content/uploads
2) upload all files of the WordPress site to the bitbucket.org repository Am
I thinking right? ? Or am I missing something? What commands and in what sequence are needed to implement these two points?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Druzhaev, 2017-09-16
@OtshelnikFm

Start a new project in NetBeans. Select a php project from a remote server. We are synchronizing with a local folder.
The project has been launched. Initialize git.
We make a commit
Then we make the first commit and specifies the bitbucket path to its repository (previously created private)
.
If you are editing through another editor, then just click sync in netbins and upload the changed files to it.
But I don’t mirror the whole site - but only plugins or a vp template (because everything else in WordPress is rubbish and
unnecessary) I start my own project for each plugin in netbins.
Why is the project convenient for a separate plug-in in netbins. Commits are specifically for a specific development.

L
Leonid, 2017-09-15
@easycode

Already read about plugins for WordPress: VersionPress and Revisr - maybe this is a simpler solution to the problem)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question