I have two different .Net projects, hosted on github.
I would like to create a shared "commons" library for the two projects.
How should I structure my repository to facilitate this sharing?
Ideally, a change in this common library in one project could easily be pushed into the other project. I prefer to keep the code itself editable from the two projects (within Visual Studio), and not include it as a library. Are there best practices for this?
By using git submodules , you can have an independent repository inside a parent repository. So you have your web and mobile repository and then inside it, in a folder, the shared code repository. If you cd into the shared code folder, you can pull, commit, make branches and push back to the shared code.
Yes. You can put multiple projects in one Git repository but they would need to be on different branches within that repo. The Git console in ReadyAPI gives you the ability to create or switch branches from the UI.
Once you finished setting up your project and are ready to share it and its history publicly on GitHub, go to Git > GitHub > Share Project on GitHub. You can use IntelliJ IDEA to create a local Git repository and then share the project on GitHub by going to VCS > Share project on GitHub in the menu.
You can use the Git submodules: https://git-scm.com/book/en/v2/Git-Tools-Submodules
Git submodules is probably not your answer. See this blogpost that goes into further details: http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With