0

Sorry for maybe stupid question. I know it is somehow possible, but could not find any tutorial how it can be done in practice. If I will fork someone's repo, apply my fixes to my fork. How I can test it? Can I somehow "install" my own fork of this repo into my application? Can somebody guide me how to do so (install my own fork into my application)?

Let's say there is repo on GitHub. I have installed it through NuGet packages. Then I have found some bugs in there. I am thinking I have a fix, so I have forked this repo into my own GitHub profile. Then I have cloned it, opened with Visual Studio, applied fixes, pushed back into my own fork. How I can test my fixes and use my own fork in my application X?

LG3
  • 69
  • 8
  • Compile it and update the reference? It's not clear what part of NuGet is 'magic' to you here. NuGet simplifies the task of going to get a library and adding a reference to your project, but here you have the source code right in your hands, so it's difficult to understand what is confusing you. [An introduction to NuGet](https://learn.microsoft.com/en-us/nuget/what-is-nuget) – J... Apr 18 '22 at 11:54
  • Does this answer your question? [How to add a project as a reference of another project](https://stackoverflow.com/questions/37397568/how-to-add-a-project-as-a-reference-of-another-project) – J... Apr 18 '22 at 12:00
  • [Adding reference to another project from visual studio code](https://stackoverflow.com/q/2306652/327083) – J... Apr 18 '22 at 12:01
  • [How can I refer to a project from another one in c#?](https://stackoverflow.com/q/2306652/327083) – J... Apr 18 '22 at 12:02
  • Ok, maybe I understand... need to try. So you say I need to have this repo on my own computer, then I apply whatever fixes, then I just add reference from my application X to that "fixed project on my computer"? – LG3 Apr 18 '22 at 12:05
  • 2
    Yes. First, though, un-install the package from your application using NuGet - this will remove the reference to the original (unmodified) assembly so that you can then add your own reference (manually) to the alternate assembly that you have modified. – J... Apr 18 '22 at 12:07
  • 1
    Also, now that you're running a fork, keep in mind that *you* are now responsible for that code. If you update again from NuGet you will lose your changes, so you now should keep an eye on the main repo to see if any bug fixes, patches, or security updates are added. Your fork won't update itself, so if there are updates to the main branch you'll have to pull them in to your fork and rebuild if you want to continue to keep your fork up to date. – J... Apr 18 '22 at 12:19
  • 1
    Alternatively, if you think your changes have fixed a bug (and if the main repo is maintained) you could also submit your changes to the repo owners in a pull request - that way your changes could be integrated into the main package and you could go back to using NuGet (and everyone else would receive the bugfix you just added). – J... Apr 18 '22 at 12:20
  • @J... thank you! I have now got it working in my app. Did as you suggested. I will try to spot bugs and if my fixes will do the job, I will create a pull request to main repo as you pointed out! Thank you! Some less mysteries in a world of coding now for me... I have not done any studies, learning by myself and SO has been the best friend so far for finding some help to my problems. – LG3 Apr 18 '22 at 12:53

0 Answers0