简体   繁体   English

如何提交在远程服务器上进行的git更改

[英]How to commit git changes made on remote server

I'm using git to manage a wordpress site hosted on a remote server. 我正在使用git管理托管在远程服务器上的wordpress网站。 Working locally and pushing my changes to the server is working well. 在本地工作并将我的更改推送到服务器运行良好。 But sometimes I log into wordpress admin and make changes on the remote server, and I don't know how to get these added to git in a way that I can pull them to my local machine. 但是有时我登录到wordpress admin并在远程服务器上进行更改,但我不知道如何以将它们添加到本地计算机的方式将它们添加到git中。 I hope this makes sense, I'm new to git and it's kind of confusing. 我希望这是有道理的,我是git的新手,这有点令人困惑。 Thanks for your help! 谢谢你的帮助!

Edit: I do have shell access to the remote server if that helps. 编辑:如果有帮助,我确实可以访问远程服务器。

The changes you make with Wordpress Admin are not saved in local files (in the git repository) but in the database. 您使用Wordpress Admin所做的更改不会保存在本地文件(在git存储库中)中,而是保存在数据库中。 The Way to go is to dump the remote database to a file and import that on your local machine. 解决方法是将远程数据库转储到文件,然后将其导入本地计算机。 The Process is best described in the wordpress documentation: Backing_Up_Your_Database 最好在wordpress文档中描述该过程: Backing_Up_Your_Database

There are also plugins that automate the progress. 还有一些插件可以自动完成进度。 Described at the end of the Article. 在文章末尾进行描述。 I recently tried to get an automatic git workflow, but it is not easy with free plugins. 我最近尝试获得自动git工作流程,但是使用免费插件并不容易。 What can help you is wp_cli . wp_cli可以帮助您。 It will add command line commands for exporting the database. 它将添加用于导出数据库的命令行命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM