Sharing code between two different git projects

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?

Answers


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/


Need Your Help

Dynamic Sprite creating in SWIFT

swift text dynamic sprite

I am trying to create a tile for a game and have a small graphic and want to center a letter in the middle of it.

Facebook Signed Request for iOS (HMAC SHA256)

iphone objective-c ios facebook sha256

I've been trying to generate HMAC SHA256 for Facebook signed request on iOS for weeks now. I am desperate need of help.