Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When your pull request is approved, you can then Squash and Merge the branch into masters. This can be done on the web client. 

Git Diff Tool for the Schematic Library

Titus Chow has created a bash script that finds changes in the schematic library across two branches. It is recommended that you use Bash on Ubuntu on Windows for Windows 10.

  1. Navigate to your local hardware repo with Bash on Ubuntu on Windows
Code Block
cd mnt/c/Users/<username>/<repo location>


 Dealing With Merge Conflicts

Scenario 1: Library in the branch supersedes the changes in master

This scenario occurs if you master has been updated since the last time you pulled from it, and you made changes on top of that. By choosing "ours", you replace the file in master with the file on your branch. This means that your branch must contain any other changes that were made on master, in addition to your own changes. 

Example: 

We have 3 branches: master, A, and elec_191_chaos_layout. A has been merged into master already, with a small change to the PCB library in the form of a deleted pad. elec_191_chaos_layout has the same pad deleted, and a few other additions/changes made to other components. To merge elec_191_chaos_layout into master, we first run merge, and then check status: 

Code Block
$ git merge master
warning: Cannot merge binary files: altium-lib/Footprints.PcbLib (HEAD vs. master)
Auto-merging altium-lib/Footprints.PcbLib
CONFLICT (content): Merge conflict in altium-lib/Footprints.PcbLib
Automatic merge failed; fix conflicts and then commit the result.


$ git status
On branch elec_191_chaos_layout
Your branch is up-to-date with 'origin/elec_191_chaos_layout'.
You have unmerged paths.
  (fix conflicts and run "git commit")
  (use "git merge --abort" to abort the merge)

Changes to be committed:

        modified:   MSXII-Controller-Board/Controller-Board-Rev3.PcbDoc
        modified:   MSXII-Controller-Board/Controller-Board.PrjPcb
        modified:   MSXII-Controller-Board/Controller_Board_Main.SchDoc
        modified:   MSXII-Controller-Board/Controller_Board_Power_Supply.SchDoc
        new file:   MSXII-Controller-Board/Project Outputs for Controller-Board/Controller-Boa
        new file:   MSXII-Controller-Board/Project Outputs for Controller-Board/ControllerBoar
        new file:   MSXII-Controller-Board/Project Outputs for Controller-Board/Design Rule Ch
        new file:   MSXII-Controller-Board/Project Outputs for Controller-Board/Design Rule Ch

Unmerged paths:
  (use "git add <file>..." to mark resolution)

        both modified:   altium-lib/Footprints.PcbLib

From this, we can see that the change common to both elec_191 and master is the Footprints library. We want to choose our Footprint library over the one in master: 

Code Block
$ git checkout --ours altium-lib/Footprints.PcbLib
$ git add

Then run status again: 

Code Block
$ git status
On branch elec_191_chaos_layout
Your branch is up-to-date with 'origin/elec_191_chaos_layout'.
All conflicts fixed but you are still merging.
  (use "git commit" to conclude merge)

Changes to be committed:

        modified:   MSXII-Controller-Board/Controller-Board-Rev3.PcbDoc
        modified:   MSXII-Controller-Board/Controller-Board.PrjPcb
        modified:   MSXII-Controller-Board/Controller_Board_Main.SchDoc
        modified:   MSXII-Controller-Board/Controller_Board_Power_Supply.SchDoc
        new file:   MSXII-Controller-Board/Project Outputs for Controller-Board/Controller-Boa
        new file:   MSXII-Controller-Board/Project Outputs for Controller-Board/ControllerBoar
        new file:   MSXII-Controller-Board/Project Outputs for Controller-Board/Design Rule Ch
        new file:   MSXII-Controller-Board/Project Outputs for Controller-Board/Design Rule Ch

Then you can commit, and push as normal. After this, you should now be able to squash and merge on GitHub using the web interface.