My collection of shell functions and configuration files for WordPress development, WP database operations, deployments and system utilities.
dotfiles/
├── shell/
│ ├── deployment.sh # Deployment functions (firstdeploy, depto, etc.)
│ ├── git.sh # Git utilities and branch management
│ ├── utils.sh # System utilities and common aliases
│ ├── wp-core.sh # WordPress core functions (getups, pushups, etc.)
│ └── wp-db.sh # WordPress database operations (pullprod, pullstage, etc.)
├── .gitignore
└── README.md
-
Clone this repository:
cd ~ git clone [email protected]:davemac/dotfiles.git
-
Create a symbolic link to your home directory:
ln -s ~/dotfiles/shell ~/.shell-functions
-
Add the following to your
~/.zprofile
:# Load shell functions for file in ~/.shell-functions/*.sh; do source "$file" # Force reload of aliases alias -g done
-
Reload your profile:
source ~/.zprofile
getups
: Sync WordPress uploads directory from remotepushups
: Push uploads to remote serverwp74
: Execute WP-CLI with PHP 7.4- various WP-CLI aliases and utilities
pullprod
: Pull production database to localpullstage
: Pull staging database to localpulltest
: Pull testing database to localpushstage
: Push local database to staging
firstdeploy
: Initial site deployment to stagingfirstdeploy-prod
: Initial site deployment to productiondepto
: Deploy theme files to staging or production
new_branch
: Create new branch from ticket ID and title- Various git aliases and shortcuts
- File system helpers
- Network utilities
- Homebrew shortcuts
- Directory navigation
- Chrome proxy setup
Sync uploads from live site:
cd ~/Sites/yoursite
getups l # Sync all uploads
getups l -latest # Sync only last 2 months
Pull production database:
cd ~/Sites/yoursite/wp-content/themes/yoursite
pullprod
Deploy theme to staging:
cd ~/Sites/yoursite/wp-content/themes/yoursite
depto -auto -target staging
Create new feature branch:
new_branch IR-123 "add new feature" # Creates feature/IR-123-add-new-feature
- macOS
- Homebrew
- PHP 7.4+ (if using wp74)
- WP-CLI
- Git
- SSH access to deployment servers
~/
├── .shell-functions -> /Users/dave/dotfiles/shell/
└── dotfiles/
├── shell/
│ ├── deployment.sh
│ ├── git.sh
│ ├── utils.sh
│ ├── wp-core.sh
│ └── wp-db.sh
├── .gitignore
└── README.md
To update the functions:
cd ~/dotfiles
git pull
No additional steps needed as the symbolic link will always point to the current files.
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request