-
Add the remote link:
git remote add libraries https://github.com/imciner2/KiCad-Libraries.git -
Get the current libraries:
git fetch libraries -
Initially add the libraries to a project:
git read-tree --prefix=2-Hardware/libraries -u libraries/master -
Commit the libraries into the repository:
git commit -m "Kicad libraries initial commit"
-
Fetch the libraries repository (if an error occurs running this command, add the remote library again)
git fetch libraries -
Merge the changes
git merge -s subtree --squash libraries/master -
Commit the changes
git commit -m "Updated libraries directory"
-
Create commits for the changes (make them seperate from everything else)
-
Fetch the libraries repository (if an error occurs running this command, add the remote library again)
git fetch libraries -
Create a new branch locally
git checkout -b library-work libraries/master -
Add the commits to the desired commits to the new branch (The command shown below will use the 5th commit before the current revision, simply modify the 5 to change which commit is referenced).
git cherry-pick -x --strategy=subtree master~5 -
Push the changes back to the library master
git push libraries library-work:master -
Change back to the project repository
git checkout master -
Delete the working branch
git branch -D library-work