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.

  • java git-library with configurable in-memory FileSystem
  • Heroku deployment error - 'We're sorry, but something went wrong"
  • Increment a number in Bitbucket pipelines
  • Workflow: git-repository with sub-modules to release
  • Can the runtime of a Heroku app know it's commit id?
  • Automate vi / nano editor for git commit --amend
  • 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?

  • Is it possible to clone git config from remote location?
  • npm install command doing nothing
  • How to resolve a compilation error when installing Git 2.0 on slackware?
  • git & svn externals - a final solution yet?
  • Git / detached HEAD, get work back?
  • GitHub taking forever to push/pull on Ubuntu 11.04
  • 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.