{"id":29952,"date":"2023-03-06T01:23:30","date_gmt":"2023-03-06T01:23:30","guid":{"rendered":"https:\/\/www.wpstaq.com\/knowledgebase\/clear-cache-automatically-when-using-a-git-repository\/"},"modified":"2025-05-19T06:16:05","modified_gmt":"2025-05-19T06:16:05","slug":"clear-cache-automatically-when-using-a-git-repository","status":"publish","type":"knowledgebase","link":"https:\/\/www.wpstaq.com\/gb\/knowledgebase\/clear-cache-automatically-when-using-a-git-repository\/","title":{"rendered":"Clear Cache automatically when using a Git Repository"},"content":{"rendered":"<h2><strong>Question<\/strong><\/h2>\n<p>Can Staq cache automatically clear the site&#8217;s cache every time I update the plugin or theme&#8217;s repo?<\/p>\n<h2>Solution<\/h2>\n<p>It is now possible to have the Staq Cache clear automatically when you&#8217;re using a repo like Bitbucket or Github.<\/p>\n<p>Below are the steps.<\/p>\n<h3>Step 1<\/h3>\n<p>Go to your custom theme\/plugin&#8217;s repo.<\/p>\n<h3>Step 2<\/h3>\n<p>Inside that theme or plugin, create file name in the main directory:<\/p>\n<p style=\"padding-left: 40px;\"><b>.stq_postdeploy<\/b><\/p>\n<p>Be sure to include the full stop at the start of the file name.<\/p>\n<h3>Step 3<\/h3>\n<p>Paste the following WP CLI command inside the file:<\/p>\n<div>\n<p><code><b># Clear cache<\/b><\/code><\/p>\n<p><code><b>wp wpstaq clear-pagebuilder-cache --reason='Aute-clear after Git-pull'\u00a0<\/b><\/code><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<h3>Step 4<\/h3>\n<p>You&#8217;re done!<\/p>\n<p>Each time Staq pulls information from your repo, our system will look for ..\/.stq_postdeploy file and it exists, it will parse it and run the WP CLI command to clear the cache.<\/p>\n","protected":false},"featured_media":29662,"parent":0,"template":"","class_list":["post-29952","knowledgebase","type-knowledgebase","status-publish","has-post-thumbnail","hentry","categories-caching-git"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Clear Cache automatically when using a Git Repository - Managed Hosting Platform for WordPress<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wpstaq.com\/knowledgebase\/clear-cache-automatically-when-using-a-git-repository\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Clear Cache automatically when using a Git Repository - Managed Hosting Platform for WordPress\" \/>\n<meta property=\"og:description\" content=\"Question Can Staq cache automatically clear the site&#8217;s cache every time I update the plugin or theme&#8217;s repo? Solution It is now possible to have the Staq Cache clear automatically when you&#8217;re using a repo like Bitbucket or Github. Below are the steps. Step 1 Go to your custom theme\/plugin&#8217;s repo. Step 2 Inside that&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wpstaq.com\/knowledgebase\/clear-cache-automatically-when-using-a-git-repository\/\" \/>\n<meta property=\"og:site_name\" content=\"Managed Hosting Platform for WordPress\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/staqhosting\/\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-19T06:16:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2023\/05\/git-integration.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1002\" \/>\n\t<meta property=\"og:image:height\" content=\"502\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/clear-cache-automatically-when-using-a-git-repository\\\/\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/clear-cache-automatically-when-using-a-git-repository\\\/\",\"name\":\"Clear Cache automatically when using a Git Repository - Managed Hosting Platform for WordPress\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/clear-cache-automatically-when-using-a-git-repository\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/clear-cache-automatically-when-using-a-git-repository\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/git-integration.png\",\"datePublished\":\"2023-03-06T01:23:30+00:00\",\"dateModified\":\"2025-05-19T06:16:05+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/clear-cache-automatically-when-using-a-git-repository\\\/#breadcrumb\"},\"inLanguage\":\"en-gb\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/clear-cache-automatically-when-using-a-git-repository\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-gb\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/clear-cache-automatically-when-using-a-git-repository\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/git-integration.png\",\"contentUrl\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/git-integration.png\",\"width\":1002,\"height\":502},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/knowledgebase\\\/clear-cache-automatically-when-using-a-git-repository\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.wpstaq.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Clear Cache automatically when using a Git Repository\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#website\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/\",\"name\":\"Managed Hosting Platform for WordPress\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.wpstaq.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-gb\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#organization\",\"name\":\"Staq\",\"alternateName\":\"WPStaq\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-gb\",\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/cropped-LogoNoText.png\",\"contentUrl\":\"https:\\\/\\\/www.wpstaq.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/cropped-LogoNoText.png\",\"width\":512,\"height\":512,\"caption\":\"Staq\"},\"image\":{\"@id\":\"https:\\\/\\\/www.wpstaq.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/staqhosting\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/wpstaq\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Clear Cache automatically when using a Git Repository - Managed Hosting Platform for WordPress","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wpstaq.com\/knowledgebase\/clear-cache-automatically-when-using-a-git-repository\/","og_locale":"en_US","og_type":"article","og_title":"Clear Cache automatically when using a Git Repository - Managed Hosting Platform for WordPress","og_description":"Question Can Staq cache automatically clear the site&#8217;s cache every time I update the plugin or theme&#8217;s repo? Solution It is now possible to have the Staq Cache clear automatically when you&#8217;re using a repo like Bitbucket or Github. Below are the steps. Step 1 Go to your custom theme\/plugin&#8217;s repo. Step 2 Inside that&hellip;","og_url":"https:\/\/www.wpstaq.com\/knowledgebase\/clear-cache-automatically-when-using-a-git-repository\/","og_site_name":"Managed Hosting Platform for WordPress","article_publisher":"https:\/\/www.facebook.com\/staqhosting\/","article_modified_time":"2025-05-19T06:16:05+00:00","og_image":[{"width":1002,"height":502,"url":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2023\/05\/git-integration.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wpstaq.com\/knowledgebase\/clear-cache-automatically-when-using-a-git-repository\/","url":"https:\/\/www.wpstaq.com\/knowledgebase\/clear-cache-automatically-when-using-a-git-repository\/","name":"Clear Cache automatically when using a Git Repository - Managed Hosting Platform for WordPress","isPartOf":{"@id":"https:\/\/www.wpstaq.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.wpstaq.com\/knowledgebase\/clear-cache-automatically-when-using-a-git-repository\/#primaryimage"},"image":{"@id":"https:\/\/www.wpstaq.com\/knowledgebase\/clear-cache-automatically-when-using-a-git-repository\/#primaryimage"},"thumbnailUrl":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2023\/05\/git-integration.png","datePublished":"2023-03-06T01:23:30+00:00","dateModified":"2025-05-19T06:16:05+00:00","breadcrumb":{"@id":"https:\/\/www.wpstaq.com\/knowledgebase\/clear-cache-automatically-when-using-a-git-repository\/#breadcrumb"},"inLanguage":"en-gb","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wpstaq.com\/knowledgebase\/clear-cache-automatically-when-using-a-git-repository\/"]}]},{"@type":"ImageObject","inLanguage":"en-gb","@id":"https:\/\/www.wpstaq.com\/knowledgebase\/clear-cache-automatically-when-using-a-git-repository\/#primaryimage","url":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2023\/05\/git-integration.png","contentUrl":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2023\/05\/git-integration.png","width":1002,"height":502},{"@type":"BreadcrumbList","@id":"https:\/\/www.wpstaq.com\/knowledgebase\/clear-cache-automatically-when-using-a-git-repository\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.wpstaq.com\/"},{"@type":"ListItem","position":2,"name":"Clear Cache automatically when using a Git Repository"}]},{"@type":"WebSite","@id":"https:\/\/www.wpstaq.com\/#website","url":"https:\/\/www.wpstaq.com\/","name":"Managed Hosting Platform for WordPress","description":"","publisher":{"@id":"https:\/\/www.wpstaq.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wpstaq.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-gb"},{"@type":"Organization","@id":"https:\/\/www.wpstaq.com\/#organization","name":"Staq","alternateName":"WPStaq","url":"https:\/\/www.wpstaq.com\/","logo":{"@type":"ImageObject","inLanguage":"en-gb","@id":"https:\/\/www.wpstaq.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2023\/05\/cropped-LogoNoText.png","contentUrl":"https:\/\/www.wpstaq.com\/wp-content\/uploads\/2023\/05\/cropped-LogoNoText.png","width":512,"height":512,"caption":"Staq"},"image":{"@id":"https:\/\/www.wpstaq.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/staqhosting\/","https:\/\/www.linkedin.com\/company\/wpstaq"]}]}},"_links":{"self":[{"href":"https:\/\/www.wpstaq.com\/gb\/wp-json\/wp\/v2\/knowledgebase\/29952","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wpstaq.com\/gb\/wp-json\/wp\/v2\/knowledgebase"}],"about":[{"href":"https:\/\/www.wpstaq.com\/gb\/wp-json\/wp\/v2\/types\/knowledgebase"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wpstaq.com\/gb\/wp-json\/wp\/v2\/media\/29662"}],"wp:attachment":[{"href":"https:\/\/www.wpstaq.com\/gb\/wp-json\/wp\/v2\/media?parent=29952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}