1

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Joff
  • 11,247
  • 16
  • 60
  • 103
  • Could you clarify what you mean saying "make an entirely different directory"? Do you mean making new directories for each version? – lucash Aug 13 '16 at 07:46
  • no, not for each version I mean for source code. I am asking if I should place my source code in the same dir as the Makefile, etc. or in a separate folder `src`.? or something and use that as the git repo and have my Makefiles in a parent drectory – Joff Aug 13 '16 at 08:15

1 Answers1

3

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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • ok, the crux of my question is where to store the source files..In the same directory as the Makefiles or in a subdirectory named `src` or something like that... – Joff Aug 13 '16 at 08:16
  • @deltaskelta If the sources are many files and with multiple subfolders, then yes, you can isolate them in their own folders. – VonC Aug 13 '16 at 08:19