Added new tip on package naming, little details.
Do you have some code you want to share but you don't know exactly how? Well, writing open-source is complex process.
In this series, I'll break it down to the smallest steps possible, so that you can start your own open-source project with zero-knowledge.
Ready? Let's start with creating a Github repository!
If not already, register on Github. It's a place where all open-source lives and breathes. For free!
Then create a repository with New Repository button.
Nice theory. What about some examples?
That's all you need now. Hit "Create repository" and you are done!
Now we practise first few git lines.
Move to the directory, where you want to host your package locally.
Open command line or Terminal in PHPStorm. Actually the PHPStorm way will open terminal already in right place. So you don't have to browse directories via cd
command.
And call these commands there.
Do you know git?
Just follow commands, that appeared on your Github repository and skip to next headline.
echo "# OpenSourcePackageDemo" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:tomasvotruba/open-source-package-demo.git
git push -u origin master
These commits can be divided into 2 groups:
Create an empty repository git repository
git init
Add ONLINE address where we want publish your code
git remote add origin git@github.com:tomasvotruba/open-source-package-demo.git
Create a file README.md and add "Unziping Package" in it (this is just command line for geeks, I do this manually in my PHPStorm of course)
echo "Unziping Package" >> README.md
Tell git to NOTICE this file to be added later
git add README.md
Group all NOTICED files to single COMMIT (group of changes)
git commit -m "first commit"
Send ALL COMMITS online. Now your local system and Github repository are synced 1:1
git push -u origin master
Just feel the smell of success.
Fast and clear? Go to PHP Package Checklist, that is easy to read and easy to follow. This helped me to integrate workflow to all my packages in the start. I've selected 9 most important points.
Some of them I've already mentioned. Other will follow in next 2 articles.
Before creating next package, just go trough it to remind yourself what is most relevant.
What have you learned today?
Happy coding!
Do you learn from my contents or use open-souce packages like Rector every day?
Consider supporting it on GitHub Sponsors.
I'd really appreciate it!