سؤال

Is it possible to exclude certain commits from being pushed to a service hook on Github? For example, if I only edit the Readme file of a project, it makes no sense to re-test the entire application on Travis. Is there a way I can tell Git that that particular commit should not be sent to the Travis hook?

هل كانت مفيدة؟

المحلول

To answer the Travis-related part: As explained in the Travis docs you can skip a build if you append [ci skip] to any of the commits you're going to push.

نصائح أخرى

There isn't a way to tell git push to skip hooks. You could, however, modify the hook to examine the received commit and only run the tests if a source file has been modified. How you do that depends on your project, but it could look for files with a certain extension, files in the src/ directory, etc.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top