Merging PRs
Main Challenge
Because of how git doesn't work well with binary files, it's almost impossible to merge files using a diff or built-in git tool. Therefore our workaround is to manually copy in the changes you made into two new files, and replace the existing libraries with these new files.
Detailed Steps
Follow the following steps after your PR has been approved and boards have been sent out. The overall idea is to copy your library changes manually and replace the library on master with your new updated ones. This should include the latest library on master with your changes included. Then when you merge the branch, you can overwrite the libraries in master with your own.
Pull the most recent master with the following commands. It would be helpful to note the last commit to Github that changed the library, and make sure this change is still present after you've made your changes later on.
git checkout master git pull
Rename the libraries in altium-lib to something new. This is so that when you checkout your own branch, the libraries from master remain on your local computer.
hardware | +-- altium-lib | + Schematic Diagrams Master.SchLib + Footprints Master.PcbLib
Checkout your branch with the following commands, and you should see something like this in your directory
git checkout hw_xxx_branch_name git pull
hardware | +-- altium-lib | + Schematic Diagrams Master.SchLib + Footprints Master.PcbLib + Schematic Diagrams.SchLib + Footprints.PcbLib
- Open both libraries with altium, and manually copy over every changed component from "Schematic Diagrams.SchLib" to "Schematic Diagrams Master.SchLib" . For components that were modified, make sure you replace the component instead of creating another one.
- Once this is done, delete the files from your branch "Schematic Diagrams.SchLib" and "Footprints.PcbLib" and rename the two files from master back to their original names. You should now have libraries that are both the latest from master and have your changes in them.
- Now follow the instructions in Version Control and Workflow for Dealing with Merge Conflicts
Make sure to choose ours branch instead of theirs for the two library files
git checkout --ours altium-lib/Schematic Diagrams.PcbLib git checkout --ours altium-lib/Footprints.PcbLib $ git add.
Now you should be able to push your changes with a commit message, and merge your branch using the web interface on Github.