Git (and Python) workflow when contributing to the official KiCad libraries: Difference between revisions

no edit summary
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 5:
 
== The KLC ==
The KiCad Library Convention (KLC) is a set of requirements for contributing to the official KiCad libraries.<ref>[http://kicad-pcb.org/libraries/klc/ KiCad Library Convention], v3.0.17</ref>
 
The things that are really important still need to be hand checked. This is the main work that library maintainers do. For example the pin numbers, names and types still needs to be compared to the datasheet, for footprints a dimension check is also required.<ref name="cont-parts"/>
Line 22:
Use schlib/checklib.py to check KLC compliance of schematic symbol libraries.
 
== GitHub (out of date, now hosted at GitLab) ==
[[GitHub]] simply hosts a Git server and provides a nice web interface.<ref name="git4newbs">[https://forum.kicad.info/t/git-and-the-libraries-for-newbies/15010 Git and the libraries for newbies], KiCad.info Forums, Feb 2019</ref> The official KiCad libraries are hosted on GitHub.
 
Line 56:
 
=== Initial setup ===
ToThe setfirst globalthing Gitto configurationdo optionsis suchto set your asuser usernamename and email usingaddress, every Git commit will use this information. Use the git config command. If you passwith the --global option this only needs to be done once.:<ref name="atl">[https://www.atlassian.com/git/tutorials/setting-up-a-repository Setting up a repository], atlassian.com</ref><ref>[https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup Getting Started - First-Time Git Setup], git-scm.com</ref>
 
To setup the user name
Line 99:
</syntaxhighlight>
 
Add the official KiCad repo as another remote. This takes care of keeping all branches up-to-date between your downstream repository or fork ("origin") and the KiCad repo ("upstream"). This only needs to be done once:<ref name="atl"/><ref name="howto">[https://medium.com/sweetmeat/how-to-keep-a-downstream-git-repository-current-with-upstream-repository-changes-10b76fad6d97 How to keep a downstream git repository current with upstream repository changes]</ref>
<syntaxhighlight lang="linux-config">
git remote add upstream https://github.com/KiCad/kicad-footprints.git
Line 144:
git push # push your fixes to GitHub (will automatically appear in the pull request)
</syntaxhighlight><ref name="git4newbs"/><ref name="">[https://forum.kicad.info/t/workflow-for-better-kicad-library-contribution-git-kicad/10593/3 Workflow for better KiCad library contribution (Git + KiCad)], KiCad.info Forums, May 2018</ref>
 
To keep your fork current with the upstream repository:<ref name="howto"/>
<syntaxhighlight lang="linux-config">
$ git merge upstream/master
</syntaxhighlight>
 
<!-- == See also == -->
== Further reading ==
* ''Pro Git'' by Scott Chacon, Ben Straub Paperback, Apress, Nov. 2014, {{ISBN |9781484200773}}
 
== References ==
Line 154 ⟶ 159:
== External links ==
=== KiCad ===
* [http://kicad-pcb.org/libraries/contribute/ Contributing to the KiCad libraries]
* [https://github.com/KiCad KiCad EDA], GitHub repositories
* [https://github.com/kicad/kicad-library-utils KiCad/kicad-library-utils]
* [http://kicad-pcb.org/libraries/klc/ KiCad Library Convention]
* [https://forum.kicad.info/t/library-management-in-kicad-version-5/14636 Library management in KiCad version 5], KiCad.info Forums
==== Tutorials ====