Henrik P. Hessel
Henrik P. Hessel

Reputation: 36617

Git - Branching and a shared code base

Well, till now, I used common git operations like push, pull, commit and clone.

But now, I need a git repo with different branches to test certain features but all these features require the same library which should be included in the repo.

What's the best pratice to do this?

Upvotes: 2

Views: 259

Answers (1)

VonC
VonC

Reputation: 1324178

git submodule would be a good practice (more on submodules here).

Reference in your project another repo which contains only your external library.
Each branch can reference the same revision of that library repo.

The idea is to memorize (actually version) the exact dependency you need directly withni your project.

Upvotes: 2

Related Questions