[英]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. 我已经使用git一段时间了,我觉得我有很好的处理。
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. 然而,我确实构建了我的第一个小程序作为发行版(带有
./configure
make
和make install
东西),我想把它放在github上,但我不确定如何完全跟踪它。
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) 例如,我应该初始化git但只跟踪源代码文件,联机帮助页和自述文件(因为
autoconf
和automake
生成的其他文件似乎有点多余)
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? 或者我应该创建一个完全不同的目录并将源文件放在那里,然后手动重建版本0.2的所有内容时间?
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. 我尝试过搜索,但我无法想出任何能够提供我想要的搜索结果的搜索字词。
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)
例如初始化git但只跟踪源代码文件,联机帮助页和自述文件(因为autoconf和automake生成的其他文件似乎有点多余)
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 "; 但另请参阅“ 在不同目录中包含源文件的Makefile ”; you don't have just one Makefile.
你没有一个 Makefile。
The traditional way is to have a
Makefile
in each of the subdirectories (part1
,part2
, etc.) allowing you to build them independently.传统方法是在每个子目录(
part1
,part2
等)中都有一个Makefile
,允许您独立构建它们。
Further, have aMakefile
in the root directory of the project which builds everything.此外,在项目的根目录中有一个
Makefile
,它可以构建所有内容。
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 . 另请参阅此问题作为具体示例 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.