Jump to content
  • 0

Help, my Github project splits up!



My SAME54 project is growing every day, and I have to make a decision how to manage my code. Maybe someone has an advise for me?

The situation is this, I started to develop the project in Studio. Later, some people persuaded my to rebuild my project to work with XC32 along with the headers from XC. So I made a branch "MPLABX_Branch" to put the modified project there. Now I have a complete parallel branch with different register names and it's quite a pain to maintain them both if I want to add something new.

Should I put the branch into a new repository? Or should clutter up the code with a lot of #ifdefs for XC and GCC? What would be the best approach?


Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • Member

Depends on what you need of course 🙂

You need a repository for everything that will become a stand-alone project/product, something you would like to give a version number. Branches are temporary things that you will delete. Forks are new projects which are unique projects themselves, based on another project, like a fork in the road it takes you to a new destination.

Looking at your project I think you should not have 2 branches. If you want this to be 1 project/product you should merge the branches so that you can use the shared code and use either separate folders or defines to get your code to cross-compile. If you want them to be 2 separate projects you should make a second repo with the other project.

Just a side-note. Cut and paste is a perfectly reasonable way to re-use code. If you make one repo which cross compiles you are not just sharing code, your projects actually have a hard dependency on each other, which mean you can never change the one without profoundly affecting the other one. This kind of "marriage" of projects is often not the intent of sharing code, so take care to not end up with unwanted dependencies.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.


  • Create New...