Skip to content

Instantly share code, notes, and snippets.

@BFTrick
Last active October 27, 2023 14:55
  • Star 28 You must be signed in to star a gist
  • Fork 14 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save BFTrick/11294357 to your computer and use it in GitHub Desktop.
Download & Install WordPress via Curl
curl -O https://wordpress.org/latest.zip
unzip latest.zip
mv wordpress site
rm latest.zip
@skoskie
Copy link

skoskie commented Jul 20, 2019

Assuming you want something like the following file structure:

ProjectName/Repo/.git/
                /public/

You can get started really quickly by doing the following:

cd ProjectName/Repo ... this should be an empty directory.

Then run this as one big command:

git init && \
curl https://raw.githubusercontent.com/github/gitignore/master/WordPress.gitignore > .gitignore && \
curl -LO https://wordpress.org/latest.zip && \
unzip latest.zip && \
rm latest.zip && \
mv wordpress public && \
mv ./public/wp-config-sample.php ./wp-config.php

I should note that I keep wp-config.php one level above the web root, which is what the last line does. If that's not your thing, kill the last line and the && \ from the second-to-last line.

Hope that helps someone kick off a new project faster.

@skoskie
Copy link

skoskie commented Jul 20, 2019

... I suppose you could go ahead and add the first commit too.

git add --all && \
git commit -sq -m "Initial commit of Wordpress core files. Hello World."

@BFTrick
Copy link
Author

BFTrick commented Jul 22, 2019

I updated the link in the original code. Thanks @aymanalzarrad!

@kristos80
Copy link

For those who want to move the wordpress folder to their current directory, should change:
mv wordpress site to mv wordpress/* ./

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment