diff --git a/include/git2/deprecated.h b/include/git2/deprecated.h
index 8f4ec8b..9d3a091 100644
--- a/include/git2/deprecated.h
+++ b/include/git2/deprecated.h
@@ -14,6 +14,11 @@
 #include "object.h"
 #include "refs.h"
 
+/*
+ * Users can avoid deprecated functions by defining `GIT_DEPRECATE_HARD`.
+ */
+#ifndef GIT_DEPRECATE_HARD
+
 /**
  * @file git2/deprecated.h
  * @brief libgit2 deprecated functions and values
@@ -244,3 +249,5 @@ GIT_EXTERN(void) giterr_set_oom(void);
 GIT_END_DECL
 
 #endif
+
+#endif