How to Commit to Git
Follow this guide to commit your custom WordPress plugin to GitHub.
1. Initialize the Git Repository
Navigate to your plugin directory in the terminal:
cd "/home/mnrdjmke/public_html/wp-content/plugins/matt-mullenweg-insane-o-meter"
Then initialize Git:
git init
2. Create a .gitignore File
To prevent unnecessary files from being committed, create a .gitignore
file:
nano .gitignore
Add the following lines:
# Ignore unnecessary files
*.log
*.DS_Store
node_modules/
vendor/
Press CTRL + X
, then Y
, then Enter
to save.
3. Commit Your Plugin Locally
Run the following commands:
git add .
git commit -m "Initial commit of Matt Mullenweg Insane-O-Meter plugin"
4. Create a GitHub Repository
Go to GitHub and create a new repository named matt-mullenweg-insane-o-meter
(or another name).
5. Connect Local Repo to GitHub
Copy the remote URL from GitHub and run:
git remote add origin https://github.com/eboy79/matt-mullenweg-insane-o-meter.git
Verify the remote connection:
git remote -v
6. Push Your Plugin to GitHub
Now push the code:
git branch -M main
git push -u origin main
7. Verify on GitHub
Go to your repository URL and check if the files are uploaded.
8. Optional: Add a README File
To add a README file, run:
echo "# Matt Mullenweg Insane-O-Meter" > README.md
git add README.md
git commit -m "Add README"
git push origin main
You’re Done! 🎉
Your WordPress plugin is now on GitHub. Happy coding!