How do I host my entire WordPress installation running git?

How do I host my entire WordPress installation running git? I am using Github on a Mac and I need to push all my work to a remote repository.

+3


source to share


1 answer


So the process is simple, but don't forget to include the database dump in your repository.

let's say you have the WordPress program installed at / Users / yourHome / theSite and then:

  • create or copy a site database backup to / Users / yourHome / theSite / dbdump
  • go to site folder cd /Users/yourHome/theSite

  • Complete all git add .

  • hand them over git commit -m 'Your commit message

  • set the remote repository to wherever you need to push git remote set-url origin https://example.com/remote/sample.git

  • and finally press git push -u origin master



Please note that I am assuming you already have a git repo on the site. otherwise, you need to start in the place before step 2. Don't say like step 1.5 :)git init

so after the db backup is ready you have to:

cp -rf the/db/backup/* /Users/yourHome/theSite/dbdump/
cd /Users/yourHome/theSite/dbdump
git init
git add .
git commit -m 'Your commit message'
git remote set-url origin https://example.com/remote/sample.git
git push -u origin master

      

0


source







All Articles