Copy the Files Using SCP
If you need a quick way to update your CSS without dealing with SCP every time, try one of these methods:
Instead of typing out the full command every time, use this one-liner to quickly upload just the CSS files:
shCopyEditscp -P 21098 "/home/mnrdjmke/public_html/wp-content/themes/swagdrip/dist/main.min.css" \
"/home/mnrdjmke/public_html/wp-content/themes/swagdrip/dist/main.min.css.map" \
mnrdjmke@198.54.125.196:/home/mnrdjmke/public_html/wp-content/themes/swagdrip/dist/
If you update all files in dist/
, just use:
shCopyEditscp -P 21098 "/home/mnrdjmke/public_html/wp-content/themes/swagdrip/dist/"* \
mnrdjmke@198.54.125.196:/home/mnrdjmke/public_html/wp-content/themes/swagdrip/dist/
🔥 Option 2: Create an Alias for SCP (Even Faster)
Set up an alias so you can update CSS with a single command like updatecss
.
1️⃣ Open your terminal and edit your ~/.zshrc
(or ~/.bashrc
if using Bash):
shCopyEditnano ~/.zshrc
2️⃣ Add this line at the bottom:
shCopyEditalias updatecss='scp -P 21098 "/home/mnrdjmke/public_html/wp-content/themes/swagdrip/dist/"* mnrdjmke@198.54.125.196:/home/mnrdjmke/public_html/wp-content/themes/swagdrip/dist/'
3️⃣ Save and exit (Ctrl + X
, then Y
, then Enter
).
4️⃣ Reload your terminal:
shCopyEditsource ~/.zshrc
Now, every time you need to update your CSS, just type:
shCopyEditupdatecss
🚀 Done!
🔥 Option 3: Use SSHFS (Mount Remote Folder Locally)
If you frequently edit CSS, you can mount your remote WordPress theme folder as a local directory using SSHFS. This lets you edit files directly without needing SCP.
1️⃣ Install SSHFS (if not installed):
shCopyEditbrew install sshfs
2️⃣ Create a local folder to mount the remote swagdrip
theme:
shCopyEditmkdir ~/mnt/wp-theme
3️⃣ Mount the remote folder:
shCopyEditsshfs -p 21098 mnrdjmke@198.54.125.196:/home/mnrdjmke/public_html/wp-content/themes/swagdrip/ ~/mnt/wp-theme
Now, you can edit files directly in ~/mnt/wp-theme/dist/
, and they will update on your site instantly. 🚀
To unmount, run:
shCopyEditumount ~/mnt/wp-theme
🔥 Option 4: Force Browser Cache Refresh
If you’re updating CSS but not seeing changes, force reload the page:
- Mac:
Cmd + Shift + R
- Windows/Linux:
Ctrl + Shift + R
Or append a query string to your CSS file in WordPress to force browsers to reload it:
phpCopyEdit<link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/dist/main.min.css?v=<?php echo time(); ?>">
💡 Recap:
✅ Quick SCP One-Liner → Copy files fast
✅ Alias (updatecss
) → Upload with one command
✅ SSHFS (Mount Remote Theme Locally) → Edit files directly
✅ Force Browser Cache Refresh → Avoid stale CSS
🔥 Pick what works best for you and make CSS updates lightning fast! 🚀💨