<script>!function(){functiont(t){document.documentElement.setAttribute("data-theme",t)}vare=function(){try{returnnewURLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{returnlocalStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"light")}(),function(){try{constc=newURLSearchParams(window.location.search).entries();for(var[t,e]ofc)if(t.startsWith("docusaurus-data-")){vara=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><divid="__docusaurus"><divrole="region"aria-label="Skip to main content"><aclass="skipToContent_LamT"href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><navaria-label="Main"class="navbar navbar--fixed-top"><divclass="navbar__inner"><divclass="navbar__items"><buttonaria-label="Toggle navigation bar"aria-expanded="false"class="navbar__toggle clean-btn"type="button"><svgwidth="30"height="30"viewBox="0 0 30 30"aria-hidden="true"><pathstroke="currentColor"stroke-linecap="round"stroke-miterlimit="10"stroke-width="2"d="M4 7h22M4 15h22M4 23h22"></path></svg></button><aclass="navbar__brand"href="/sparo/_preview/pr-76/"><divclass="navbar__logo"><imgsrc="/sparo/_preview/pr-76/images/site/sparo-title.svg"alt="Sparo"class="themedComponent_tC9f themedComponent--light_jvOP"><imgsrc="/sparo/_preview/pr-76/images/site/sparo-title-dark.svg"alt="Sparo"class="themedComponent_tC9f themedComponent--dark_id3o"></div><bclass="navbar__title text--truncate"></b></a><divclass="navbar__item dropdown dropdown--hoverable"><ahref="#"aria-haspopup="true"aria-expanded="false"role="button"class="navbar__link"><svgviewBox="0 0 24 24"width="20"height="20"aria-hidden="true"class="iconLanguage_STns"><pathfill="currentColor"d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path></svg>English</a><ulclass="dropdown__menu"><li><ahref="/sparo/_preview/pr-76/"target="_self"rel="noopener noreferrer"class="dropdown__link dropdown__link--active"lang="en">English</a></li></ul></div></div><divclass="navbar__items navbar__items--right"><aclass="navbar__item navbar__link"href="/sparo/_preview/pr-76/pages/guide/getting_started/">Docs</a><ahref="https://github.com/tiktok/sparo"target="_blank"rel="noopener noreferrer"class="navbar__item navbar__link">GitHub<svgwidth="13.5"height="13.5"aria-hidden="true"viewBox="0 0 24 24"class="iconExternalLink_AFhm"><pathfill="currentColor"d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><aclass="navbar__item navbar__link"href="/sparo/_preview/pr-76/pages/support/news/">News</a><aclass="navbar__item navbar__link"href="/sparo/_preview/pr-76/pages/support/help/">Help</a><divclass="toggle_dsLe colorModeToggle_c7_9"><buttonclass="clean-btn toggleButton_q0G2 toggleButtonDisabled_vKJd"type="button"disabled=""title="Switch between dark and light mode (currently light mode)"aria-label="Switch between dark and light mode (currently light mode)"aria-live="polite"><svgviewBox="0 0 24 24"width="24"height="24"class="lightToggleIcon_ZA7w"><pathfill="currentColor"d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5S14.76,7,12,7L12,7zM2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13zM20,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13zM11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2zM11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20zM5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58zM18.36,16.95c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l
<h2class="anchor anchorWithStickyNavbar_tnRO"id="clone-faster">Clone faster!<ahref="#clone-faster"class="hash-link"aria-label="Direct link to Clone faster!"title="Direct link to Clone faster!"></a></h2>
<p>Sparo optimizes performance of Git operations for your large frontend monorepo.</p>
<h2class="anchor anchorWithStickyNavbar_tnRO"id="key-features">Key features<ahref="#key-features"class="hash-link"aria-label="Direct link to Key features"title="Direct link to Key features"></a></h2>
<ul>
<li>
<p><strong>Familiar interface:</strong> The <code>sparo</code> command-line interface (CLI) wrapper offers <strong>better defaults</strong> and <strong>performance suggestions</strong> without altering the familiar <code>git</code> syntax. (The native <code>git</code> CLI is also supported.)</p>
</li>
<li>
<p><strong>A proven solution:</strong> Git provides <ahref="https://tiktok.github.io/sparo/pages/reference/git_optimization/"target="_blank"rel="noopener noreferrer">quite a lot of ingredients</a> for optimizing very large repos; Sparo is your recipe for combining these features intelligently.</p>
</li>
<li>
<p><strong>Simplified sparse checkout:</strong> Work with sparse checkout <ahref="https://tiktok.github.io/sparo/pages/guide/sparo_profiles/"target="_blank"rel="noopener noreferrer">profiles</a> instead of confusing "cones" and globs</p>
</li>
<li>
<p><strong>Frontend integration:</strong> Sparo leverages <ahref="https://rushjs.io/"target="_blank"rel="noopener noreferrer">Rush</a> and <ahref="https://pnpm.io/"target="_blank"rel="noopener noreferrer">PNPM</a> workspace configurations, including the ability to automatically checkout project dependencies</p>
</li>
<li>
<p><strong>Dual workflows:</strong> The <code>sparo-ci</code> tool implements a specialized checkout model optimized for continuous integration (CI) pipelines</p>
</li>
<li>
<p><strong>Extra safeguards</strong>: Avoid common Git mistakes such as checkouts with staged files outside the active view</p>
</li>
<li>
<p><strong>Go beyond Git hooks:</strong> Optionally collect anonymized Git timing metrics in your monorepo, enabling your build team to set data-driven goals for <em>local</em> developer experience (not just CI!)</p>
<p><em>(Metrics are transmitted to your own service and are not accessible by any other party.)</em></p>
</li>
</ul>
<h2class="anchor anchorWithStickyNavbar_tnRO"id="quick-demo">Quick demo<ahref="#quick-demo"class="hash-link"aria-label="Direct link to Quick demo"title="Direct link to Quick demo"></a></h2>
<p>Try out Sparo in 5 easy steps:</p>
<ol>
<li>
<p><em><strong>Upgrade to the latest Git version!</strong></em> For macOS, we recommend to use <ahref="https://git-scm.com/download/mac"target="_blank"rel="noopener noreferrer">brew install git</a>. For other operating systems, see the <ahref="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git"target="_blank"rel="noopener noreferrer">Git documentation</a> for instructions.</p>
</li>
<li>
<p>For this demo, we'll use the Azure SDK which is a large public <ahref="https://rushjs.io/"target="_blank"rel="noopener noreferrer">RushJS</a> monorepo from GitHub. The following command will check out the <ahref="/sparo/_preview/pr-76/pages/reference/skeleton_folders/">skeleton folders</a> but not the source code:</p>
<p>💡 Support for PNPM and Yarn workspaces is planned but not implemented yet. Contributions welcome!</p>
</blockquote>
</li>
<li>
<p>Define a <ahref="/sparo/_preview/pr-76/pages/configs/profile_json/">Sparo profile</a> describing the subset of repository folders for Git sparse checkout.</p>
<divclass="language-json codeBlockContainer_nK63 theme-code-block"style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><divclass="codeBlockContent_BFef"><pretabindex="0"class="prism-code language-json codeBlock_BUQB thin-scrollbar"style="color:#393A34;background-color:#f6f8fa"><codeclass="codeBlockLines_dbG7"><spanclass="token-line"style="color:#393A34"><spanclass="token punctuation"style="color:#393A34">{</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#393A34"><spanclass="token plain"></span><spanclass="token property"style="color:#36acaa">"selections"</span><spanclass="token operator"style="color:#393A34">:</span><spanclass="token plain"></span><spanclass="token punctuation"style="color:#393A34">[</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#393A34"><spanclass="token plain"></span><spanclass="token punctuation"style="color:#393A34">{</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#393A34"><spanclass="token plain"></span><spanclass="token comment"style="color:#999988;font-style:italic">// This demo profile will check out the "@azure/arm-commerce" project</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#393A34"><spanclass="token plain"></span><spanclass="token comment"style="color:#999988;font-style:italic">// and all of its dependencies:</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#393A34"><spanclass="token plain"></span><spanclass="token property"style="color:#36acaa">"selector"</span><spanclass="token operator"style="color:#393A34">:</span><spanclass="token plain"></span><spanclass="token string"style="color:#e3116c">"--to"</span><spanclass="token punctuation"style="color:#393A34">,</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#393A34"><spanclass="token plain"></span><spanclass="token property"style="color:#36acaa">"argument"</span><spanclass="token operator"style="color:#393A34">:</span><spanclass="token plain"></span><spanclass="token string"style="color:#e3116c">"@azure/arm-commerce"</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#393A34"><spanclass="token plain"></span><spanclass="token punctuation"style="color:#393A34">}</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#393A34"><spanclass="token plain"></span><spanclass="token punctuation"style="color:#393A34">]</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#393A34"><spanclass="token plain"></span><spanclass="token punctuation"style="color:#393A34">}</span><br></span></code></pre><divclass="buttonGroup_z3hN"><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="clean-btn"><spanclass="copyButtonIcons_p991"aria-hidden="true"><svgviewBox="0 0 24 24"class="copyButtonIcon_DQfU"><pathfill="currentColor"d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svgviewBox="0 0 24 24"class="copyButtonSuccessIcon_Yj5J"><pathfill="currentColor"d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
<p>The <code>--to</code><ahref="https://rushjs.io/pages/developer/selecting_subsets/#--to"target="_blank"rel="noopener noreferrer">project selector</a> instructs Sparo to checkout all dependencies in the workspace that are required to build <code>my-rush-project</code>.</p>
</li>
<li>
<p>After saving your changes to <strong>my-team.json</strong>, now it's time to apply it:</p>