简体   繁体   English

如何使用git与我分发的包

[英]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 makemake 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但只跟踪源代码文件,联机帮助页和自述文件(因为autoconfautomake生成的其他文件似乎有点多余)

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. 传统方法是在每个子目录( part1part2等)中都有一个Makefile ,允许您独立构建它们。
Further, have a Makefile 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.

相关问题 如何在git包上运行./configure脚本? - How do I run the ./configure script on git package? 将Python应用程序作为debian包分发,但作为服务 - Distributing Python application as a debian package, but as service 我缺少什么openGL软件包? - What openGL package am I missing? 为什么我在 git clone 上询问密码? - Why i am asking password on git clone? 如何使用与我在cron作业中使用的环境相同的环境? - How to use the same environment as the one I am using in cron jobs? 我将如何在Fakeroot Deb软件包构建器中使用postinst脚本 - How would I use postinst script with fakeroot deb package builder 如何在Ubuntu Hardy下的clisp中使用(require:PACKAGE)? - How do I use (require :PACKAGE) in clisp under Ubuntu Hardy? 我正在尝试在 R 中安装 twitteR 包,但我无法这样做 - I am trying to install the twitteR package in R but I am unable to do so 如果我在Linux OS上运行,如何使用gcc g ++编译Windows二进制文件? - How can I use gcc g++ to compile a windows binary if I am running on a Linux OS? 我目前正在Django中提供我的静态文件。 我如何使用Apache2来做到这一点? - I am currently serving my static files in Django. How do I use Apache2 to do this?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM