{"thread":{"id":"45072","subject":"``git clean -xdf'' and ``make clean''","startedAt":"2017-02-07T14:17:40Z","lastAt":"2017-02-07T19:37:49Z","messageCount":3,"participants":["Hongyi Zhao","Cornelius Weig","Jacob Keller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"310984","messageId":"CAGP6PO+qD6eRkKbWAxOfiqUQw8o+dOfgwgvt_8OxHQ5ocAopEQ@mail.gmail.com","threadId":"45072","inReplyTo":null,"subject":"``git clean -xdf'' and ``make clean''","fromName":"Hongyi Zhao","fromEmail":"hongyi.zhao@gmail.com","sentAt":"2017-02-07T14:17:34Z","receivedAt":"2017-02-07T14:17:40Z","isPatch":false,"sender":{"key":"hongyi.zhao@gmail.com","avatar":null},"body":"Hi all,\n\nIn order to delete all of the last build stuff, does the following two\nmethods equivalent or not?\n\n``git clean -xdf'' and ``make clean''\n\nRegards\n-- \nHongsheng Zhao <hongyi.zhao@gmail.com>\nInstitute of Semiconductors, Chinese Academy of Sciences\nGnuPG DSA: 0xD108493\n"},{"id":"310988","messageId":"fe8595aa-0395-e948-13e9-f952541d106e@tngtech.com","threadId":"45072","inReplyTo":"CAGP6PO+qD6eRkKbWAxOfiqUQw8o+dOfgwgvt_8OxHQ5ocAopEQ@mail.gmail.com","subject":"Re: ``git clean -xdf'' and ``make clean''","fromName":"Cornelius Weig","fromEmail":"cornelius.weig@tngtech.com","sentAt":"2017-02-07T15:07:53Z","receivedAt":"2017-02-07T15:08:13Z","isPatch":false,"sender":{"key":"cornelius.weig@tngtech.com","avatar":null},"body":"On 02/07/2017 03:17 PM, Hongyi Zhao wrote:\n> Hi all,\n> \n> In order to delete all of the last build stuff, does the following two\n> methods equivalent or not?\n> \n> ``git clean -xdf'' and ``make clean''\n\nNo, it is not equivalent.\n\n* `make clean` removes any build-related files (assuming that the\n`clean` target is properly written). To see exactly what it would do,\nrun `make clean -n`. Judging from your question, I think this is what\nyou want to do.\n\n* `git clean -xdf` would remove any files that git does not track. This\nalso includes build-related files, but also any other files that happen\nto be in your working directory. For example, any output from `git\nformat-patch` would be removed by this, but not `make clean`.\n"},{"id":"310997","messageId":"CA+P7+xpesQVS5qZJZ5wd31eJDLmb5j0Xdq_rwajjoskB07ELfg@mail.gmail.com","threadId":"45072","inReplyTo":"fe8595aa-0395-e948-13e9-f952541d106e@tngtech.com","subject":"Re: ``git clean -xdf'' and ``make clean''","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2017-02-07T19:35:23Z","receivedAt":"2017-02-07T19:37:49Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Tue, Feb 7, 2017 at 7:07 AM, Cornelius Weig\n<cornelius.weig@tngtech.com> wrote:\n> On 02/07/2017 03:17 PM, Hongyi Zhao wrote:\n>> Hi all,\n>>\n>> In order to delete all of the last build stuff, does the following two\n>> methods equivalent or not?\n>>\n>> ``git clean -xdf'' and ``make clean''\n>\n> No, it is not equivalent.\n>\n> * `make clean` removes any build-related files (assuming that the\n> `clean` target is properly written). To see exactly what it would do,\n> run `make clean -n`. Judging from your question, I think this is what\n> you want to do.\n>\n> * `git clean -xdf` would remove any files that git does not track. This\n> also includes build-related files, but also any other files that happen\n> to be in your working directory. For example, any output from `git\n> format-patch` would be removed by this, but not `make clean`.\n\nMake clean can run arbitrary code, and really depends on the\nimplementation. git clean -xdf will result in all non-tracked files\nbeing removed, which should restore you to a pristine pre-build state.\nHowever, this can have unfortunate side effect of destroying files\nwhich you might not expect.\n\nProperly written, a make clean shouldn't remove anything except what\ncould be regenerated by make. But that's just a strong convention.\n\nRegards,\nJake\n"}]}