Last active
December 18, 2015 22:29
-
-
Save mannieschumpert/5855129 to your computer and use it in GitHub Desktop.
Bash function for initializing a WordPress theme repo and setting it up to receive push.
Directories are of course specific to my workflow. Change as necessary. (Note: works with HostGator. I'm not sure if it works universally.) Git-specific info via @mexitek. http://www.arlocarreon.com/blog/git/push-git-repo-into-shared-hosting-account-like-hos…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devinit() { | |
# move to dev themes | |
cd public_html/dev/wp-content/themes | |
# create theme directory | |
mkdir ${1} | |
# move into it | |
cd ${1} | |
#initialize git | |
git init | |
# configure for receiving pushes | |
git config receive.denyCurrentBranch ignore | |
# create and append post-receive hook | |
echo "GIT_WORK_TREE=../ git checkout -f" > .git/hooks/post-receive | |
# make file executable | |
chmod +x .git/hooks/post-receive | |
# print directory for copying to set up push from local | |
pwd | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Takes one parameter: the theme folder.
Example:
devinit theme