-1

I have forked an open source project on github (https://github.com/alberthendriks/peatio/) and I want to offer functionality for the community. Peatio is a currency exchange that by default only supports CNY and BTC. Now, there are instructions to add altcoins here: https://www.snip2code.com/Snippet/205317/Adding-A-New-Cryptocurrency-to-Peatio

I want to create a feature branch that way for multiple coins (one branch for each coin), so that people can merge in the coins they want into their fork. The issue is: I think this will work if they merge in one feature branch, but if they merge in multiple, then there will be an (unnecessary) conflict. There's just some code added to multiple files for each coin and the order the code for each coin appears in a file doesn't really matter, but git will think it's a conflict because code is added at the same location. For a human this should be straightforward to fix, so hopefully there's an automatic solution as well?

Makoto
  • 104,088
  • 27
  • 192
  • 230
Albert Hendriks
  • 1,979
  • 3
  • 25
  • 45
  • 1
    Would it not be better to let the build system handle this? I.e. with options to the build system to enable specific currencies at build-time (this also makes sense for interpreted languages: the build system could configure the file where the currencies are listed). Then you could try to merge that into upstream. Users would just run ``$buildtool ENABLE_ALTCOIN=true ENABLE_FOOCOIN=false`` or whatever to get the version they want. – Jonas Schäfer Jul 11 '15 at 10:22

1 Answers1

0

Well, if one pulls before adding their own changes, there will not be conflicts. Make sure that before work has started, you pull the latest changes (that will eliminate 90% of conflicts).

If you've pulled, started working, committed, but then someone pushed before you did, you'll have a conflicts. In that case, you'll have to pull again, fix the merge conflicts, then push the changes.

Git makes this process fairly painless, and anyone who's contributing to open source is bound to run into a merge conflict eventually.

Madara's Ghost
  • 172,118
  • 50
  • 264
  • 308
  • I think you don't understand the question. You say " if one pulls before adding their own changes, there will not be conflicts." but I explained in my question why I think there will be conflicts if they merge in multiple branches. – Albert Hendriks Jul 11 '15 at 10:10