Skip to content
Advertisement

how to use git with a package I am distributing

I have been using git for some time now and I feel I have a good handle on it.

I did however, build my first small program as a distribution (something with ./configure make and make install) and I want to put it up on github but I am not sure how to exactly go about tracking it.

Should I, for instance, initialize git but only track the source code file, manpage, and readme (since the other files generated by autoconf and automake seem a bit superfluous)

Or should I make an entirely different directory and put the source files in there and then manually rebuild everything for version 0.2 when it is time?
Or do something else entirely?
I have tried searching but I cannot come up with any search terms that give me the kind of results I am looking for.

Advertisement

Answer

for instance initialize git but only track the source code file, manpage, and readme (since the other files generated by autoconf and automake seem a bit superfluous)

Yes: anything used to build needs to be tracked.
Anything being the result of the build does not need to be tracked.

should I make an entirely different directory

No: in version control, you could make a new tag to mark each version, and release branches from those tags to isolate patches which could be specific to the implementation details of a fixed release.
But you don’t create folders (that was the subversion way)

should I make an entirely different directory for sources

Yes, you can (if you have a large set of files for sources)

But see also “Makefiles with source files in different directories“; you don’t have just one Makefile.

The traditional way is to have a Makefile in each of the subdirectories (part1, part2, etc.) allowing you to build them independently.
Further, have a Makefile in the root directory of the project which builds everything.

And don’t forget to put your object files in a separate folder (not tracked) as well.

See also this question as a concrete example.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement