问题描述
我(大多数情况下)使用git从其源代码下载并编译各种项目,将我的源代码保留在/usr/local/src
中,并将二进制文件安装在/usr/local/bin
中.
I (mostly) use git to download and compile various projects from their source code, keeping my source in /usr/local/src
and installing the binaries in /usr/local/bin
.
通常在./configure && make && make install
之后,按照构建过程进行操作,剩下很多杂物,最终成为本地git存储库中的新"文件.
Following the building procedure, usually with ./configure && make && make install
, I'm left with a lot of cruft that ends up as 'new' files in my local git repository.
据我所知,make clean
,make distclean
以及可能还有(?)./configure clean
都是可以考虑的过程,目的是丢弃大多数剩余的文件.但是在特定情况下(请参见下面的示例),我一无所知才能保持清洁",例如在安装之前……
To my understanding, make clean
, make distclean
and possibly also (?) ./configure clean
are thinkable procedures in order to trash most leftover files. But in specific scenarios (see example below) I'm left clueless what thing to do in order to "stay clean", such as I was prior to the installation...
最近的示例–通过 http:/安装jscoverage(通过 git svn ) /svn.siliconforks.com/jscoverage/trunk jscoverage:
A recent example – installing jscoverage (via git svn) from http://svn.siliconforks.com/jscoverage/trunk jscoverage:
该项目的构建说明提示我使用 ./bootstrap.sh && make && make install
.在这种情况下,编译和安装完成后,我尝试了所有上述清理命令(随机),但是并没有摆脱所有问题.
The building instructions for this project prompted me to use ./bootstrap.sh && make && make install
. In this case, after compiling and installing was finished, I tried all of the aforementioned cleanup commands (by random), but didn't manage to get rid of everything.
总结一下我的问题:是否有我没有掌握的全能,卓越的清洁策略?在典型的工作流程中,使用git之类的VCS时,如何处理此清理问题:1.)下载– 2.)构建– 3.)从上游存储库提取更新– 4.)再次构建–依此类推?
To wrap my question up: Is there any all-mighty, superior cleaning strategy that I haven't grasped? How do you approach this cleanup issue when using a VCS such as git, in a typical workflow where you 1.) download – 2.) build – 3.) pull updates from upstream repository – 4.) build once again – and so forth?
推荐答案
还有git clean
(从工作树中删除未跟踪的文件").这是一个简单的命令,命令行选项相对较少.请参见 git-clean手册页.
There is also git clean
("Remove untracked files from the working tree"). It's a simple command with relatively few command line options. See the git-clean man page.
这篇关于使用例如生成源代码后的清理策略.吉特的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!