What's the best way to replace an old copy of WordPress with a fresh one and push to GitHub?

I have been version controlling my WordPress site with Git and pushing to GitHub for quite some time. I develop locally, push to GitHub, and pull from GitHub to my production server.

I would like to scrap my current WordPress core on my local environment and replace it with a fresh new copy to then be pushed to GitHub and pulled to my production server.

My question is…am I going to run into any sort of tracking errors wit Git by replacing my WordPress core? Any other suggestions for me when I do this?

  • login to WPEngine Git Push with Tower Git
  • Should build folders be included in a git repo?
  • Capistrano 3 deploy WordPress with GIT available in release dir
  • Handling Git Deployment (WordPress)
  • Where do I place my own code whilst using Vagrant+Chef+Wordpress (VCCW) repository cloned from GitHub?
  • Git and WordPress (+ managing plugins and media)
  • Wordpress - Best practice for pushing updates to multiple servers using version control
  • How to show all folders from Wordpress.org SVN plugin repo?
  • 2 Solutions collect form web for “What's the best way to replace an old copy of WordPress with a fresh one and push to GitHub?”

    I handle this by adding the WordPress core as a subrepository. WordPress maintains a mirror of their SVN repository on GitHub. Then you can update to a new version easily by going into the subdirectory containing the WordPress core files and checking out the tag for the current version:

    git fetch --tags
    git checkout 3.3.2

    The repo also includes beta releases, if you prefer those.

    Here’s the guide that I used to set up this process: Install and Manage WordPress with Git

    I understood you’re talking about updating wordpress. You should note that, like documented in the update instructions, during update you should

    • check the requirements
    • take a backup of your database contents
    • disable the plugins you have

    So all this you should do regardless. Also, you should be sure to update your database content, too, if needed.

    WordPress contains instructions on updating using svn, and it seems it is, according to them, a perfectly fine approach to have. I would see no major difference for you to do essentially the same thing with git, provided you can tell exactly which files are appropriate to store on version control and which aren’t.

    Git Baby is a git and github fan, let's start git clone.