* ``git clean -xdf'' and ``make clean'' @ 2017-02-07 14:17 Hongyi Zhao 2017-02-07 15:07 ` Cornelius Weig 0 siblings, 1 reply; 3+ messages in thread From: Hongyi Zhao @ 2017-02-07 14:17 UTC (permalink / raw) To: git Hi all, In order to delete all of the last build stuff, does the following two methods equivalent or not? ``git clean -xdf'' and ``make clean'' Regards -- Hongsheng Zhao <hongyi.zhao@gmail.com> Institute of Semiconductors, Chinese Academy of Sciences GnuPG DSA: 0xD108493 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ``git clean -xdf'' and ``make clean'' 2017-02-07 14:17 ``git clean -xdf'' and ``make clean'' Hongyi Zhao @ 2017-02-07 15:07 ` Cornelius Weig 2017-02-07 19:35 ` Jacob Keller 0 siblings, 1 reply; 3+ messages in thread From: Cornelius Weig @ 2017-02-07 15:07 UTC (permalink / raw) To: Hongyi Zhao, git On 02/07/2017 03:17 PM, Hongyi Zhao wrote: > Hi all, > > In order to delete all of the last build stuff, does the following two > methods equivalent or not? > > ``git clean -xdf'' and ``make clean'' No, it is not equivalent. * `make clean` removes any build-related files (assuming that the `clean` target is properly written). To see exactly what it would do, run `make clean -n`. Judging from your question, I think this is what you want to do. * `git clean -xdf` would remove any files that git does not track. This also includes build-related files, but also any other files that happen to be in your working directory. For example, any output from `git format-patch` would be removed by this, but not `make clean`. ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ``git clean -xdf'' and ``make clean'' 2017-02-07 15:07 ` Cornelius Weig @ 2017-02-07 19:35 ` Jacob Keller 0 siblings, 0 replies; 3+ messages in thread From: Jacob Keller @ 2017-02-07 19:35 UTC (permalink / raw) To: Cornelius Weig; +Cc: Hongyi Zhao, Git mailing list On Tue, Feb 7, 2017 at 7:07 AM, Cornelius Weig <cornelius.weig@tngtech.com> wrote: > On 02/07/2017 03:17 PM, Hongyi Zhao wrote: >> Hi all, >> >> In order to delete all of the last build stuff, does the following two >> methods equivalent or not? >> >> ``git clean -xdf'' and ``make clean'' > > No, it is not equivalent. > > * `make clean` removes any build-related files (assuming that the > `clean` target is properly written). To see exactly what it would do, > run `make clean -n`. Judging from your question, I think this is what > you want to do. > > * `git clean -xdf` would remove any files that git does not track. This > also includes build-related files, but also any other files that happen > to be in your working directory. For example, any output from `git > format-patch` would be removed by this, but not `make clean`. Make clean can run arbitrary code, and really depends on the implementation. git clean -xdf will result in all non-tracked files being removed, which should restore you to a pristine pre-build state. However, this can have unfortunate side effect of destroying files which you might not expect. Properly written, a make clean shouldn't remove anything except what could be regenerated by make. But that's just a strong convention. Regards, Jake ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-02-07 19:37 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-02-07 14:17 ``git clean -xdf'' and ``make clean'' Hongyi Zhao 2017-02-07 15:07 ` Cornelius Weig 2017-02-07 19:35 ` Jacob Keller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox