[fpc-other] GIT versioning server on Raspberry Pi?
Graeme Geldenhuys
mailinglists at geldenhuys.co.uk
Fri Jun 2 11:19:49 CEST 2017
On 2017-06-02 00:00, Bo Berglund wrote:
> The beauty of this is that we do not need to duplicate common
> functionality between projects as would be the case if we *copied* the
> common files into the source folder. These files are used in many
> places but versioned in a single place on the server.
Yes, Git has that functionality too. It is called "submodules". Common
code can live and be maintained in it's own repository. Other
repositories can than link to that repository.
https://git-scm.com/book/en/v2/Git-Tools-Submodules
https://git-scm.com/docs/git-submodule
I have used this often. If you clone a repository that makes use of
submodules, all the information is already there (stored inside the
repository).
The first time you clone such a repository, it will not automatically
fetch the files from the submodule. You need to run (only once) the 'git
submodule init' command. Then every time you want to update the
"common/shared code" you run 'git submodule update'.
The Pro Git chapter explains it very well, and it is actually quite
simple to setup and use.
Regards,
Graeme
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
My public PGP key: http://tinyurl.com/graeme-pgp
More information about the fpc-other
mailing list