CINXE.COM

Git - Distributed

<!DOCTYPE html> <html lang="en"> <head> <script type="text/javascript"> const currentTheme = localStorage.getItem("theme") if (currentTheme) { const prefersDarkScheme = window.matchMedia("(prefers-color-scheme: dark)").matches if ((prefersDarkScheme && currentTheme === "light") || (!prefersDarkScheme && currentTheme === "dark")) { document.documentElement.dataset.theme = currentTheme } } </script> <meta charset='utf-8'> <meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Git - Distributed</title> <link href="/favicon.ico" rel='shortcut icon' type='image/x-icon'> <link rel="stylesheet" href="/application.min.css"> </head> <body id="about"> <div class="inner"> <header> <a id="logo" href="/"><img src="/images/logo@2x.png" width="110" height="46" alt="Git" class="no-filter" /></a> <span id="tagline"></span> <script type="text/javascript"> const taglines = [ "fast-version-control", "everything-is-local", "distributed-even-if-your-workflow-isnt", "local-branching-on-the-cheap", "distributed-is-the-new-centralized" ]; var tagline = taglines[Math.floor(Math.random() * taglines.length)]; document.getElementById('tagline').innerHTML = '--' + tagline; </script> <div id="search-container"> <form id="search" action="/search/results"> <input id="search-text" name="search" placeholder="Type / to search entire site…" autocomplete="off" type="text" /> </form> <div id="search-results"></div> </div> <img src="/images/dark-mode.svg" id="dark-mode-button" /> </header> </div> <div class="inner"> <div id="content-wrapper"> <div tabindex="1" class="sidebar-btn"></div> <aside class="sidebar" id="sidebar"> <nav> <ul> <li> <a href="/about" class="active">About</a> <ul class="expanded"> <li> <a href="/about/branching-and-merging">Branching and Merging</a> </li> <li> <a href="/about/small-and-fast">Small and Fast</a> </li> <li> <a href="/about/distributed" class="active">Distributed</a> </li> <li> <a href="/about/data-assurance">Data Assurance</a> </li> <li> <a href="/about/staging-area">Staging Area</a> </li> <li> <a href="/about/free-and-open-source">Free and Open Source</a> </li> <li> <a href="/about/trademark">Trademark</a> </li> </ul> </li> <li> <a href="/doc">Documentation</a> <ul > <li> <a href="/docs">Reference</a> </li> <li> <a href="/book">Book</a> </li> <li> <a href="/videos">Videos</a> </li> <li> <a href="/doc/ext">External Links</a> </li> </ul> </li> <li> <a href="/downloads">Downloads</a> <ul > <li> <a href="/downloads/guis">GUI Clients</a> </li> <li> <a href="/downloads/logos">Logos</a> </li> </ul> </li> <li> <a href="/community">Community</a> </li> </ul> <hr class="sidebar"> <div class="callout"> <p>The entire <strong><a href="/book">Pro Git book</a></strong> written by Scott Chacon and Ben Straub is available to <a href="/book">read online for free</a>. Dead tree versions are available on <a href="https://www.amazon.com/Pro-Git-Scott-Chacon/dp/1484200772?ie=UTF8&camp=1789&creative=9325&creativeASIN=1430218339&linkCode=as2&tag=git-sfconservancy-20">Amazon.com</a>. </p> </div> </nav> </aside> <div id="content" data-pagefind-filter="category:about" data-pagefind-weight="0.05" data-pagefind-body> <div id="main"> <h1 data-pagefind-meta="title">About - Distributed</h1> <ol id="about-nav"> <li> <a href="/about/branching-and-merging" class="three-line">Branching and Merging</a> </li> <li> <a href="/about/small-and-fast" class="two-line">Small and Fast</a> </li> <li> <a href="/about/distributed" class="one-line current">Distributed</a> </li> <li> <a href="/about/data-assurance" class="two-line">Data Assurance</a> </li> <li> <a href="/about/staging-area" class="two-line">Staging Area</a> </li> <li> <a href="/about/free-and-open-source" class="three-line">Free and Open Source</a> </li> <li> <a href="/about/trademark" class="one-line">Trademark</a> </li> </ol> <section class="about" id="distributed"> <h2>Distributed</h2> <p> One of the nicest features of any Distributed SCM, Git included, is that it's distributed. This means that instead of doing a "checkout" of the current tip of the source code, you do a "clone" of the entire repository. </p> <h3>Multiple Backups</h3> <p> This means that even if you're using a centralized workflow, every user essentially has a full backup of the main server. Each of these copies could be pushed up to replace the main server in the event of a crash or corruption. In effect, there is no single point of failure with Git unless there is only a single copy of the repository. </p> <h3>Any Workflow</h3> <p> Because of Git's distributed nature and superb branching system, an almost endless number of workflows can be implemented with relative ease. </p> <h4>Subversion-Style Workflow</h4> <p> A centralized workflow is very common, especially from people transitioning from a centralized system. Git will not allow you to push if someone has pushed since the last time you fetched, so a centralized model where all developers push to the same server works just fine. </p> <p class="center"> <img src="/images/about/workflow-a@2x.png" width="415" height="209" alt="Workflow A"> </p> <h4>Integration Manager Workflow</h4> <p> Another common Git workflow involves an integration manager — a single person who commits to the 'blessed' repository. A number of developers then clone from that repository, push to their own independent repositories, and ask the integrator to pull in their changes. This is the type of development model often seen with open source or GitHub repositories. </p> <p class="center"> <img src="/images/about/workflow-b@2x.png" width="407" height="164" alt="Workflow B"> </p> <h4>Dictator and Lieutenants Workflow</h4> <p> For more massive projects, a development workflow like that of the Linux kernel is often effective. In this model, some people ('lieutenants') are in charge of a specific subsystem of the project and they merge in all changes related to that subsystem. Another integrator (the 'dictator') can pull changes from only his/her lieutenants and then push to the 'blessed' repository that everyone then clones from again. </p> <p class="center"> <img src="/images/about/workflow-c@2x.png" width="562" height="303" alt="Workflow C"> </p> <div class="bottom-nav" style="display: block;"> <a href="/about/small-and-fast" class="previous" data-section-id="small-and-fast">← Small and Fast</a> <a href="/about/data-assurance" class="next" data-section-id="info-assurance">Data Assurance →</a> </div> </section> </div> </div> </div> <footer> <div class="site-source"> <a href="/site">About this site</a><br> Patches, suggestions, and comments are welcome. </div> <div class="sfc-member"> Git is a member of <a href="/sfc">Software Freedom Conservancy</a> </div> </footer> <a href="#top" class="no-js scrollToTop" id="scrollToTop" data-label="Scroll to top"> <img src="/images/icons/chevron-up@2x.png" width="20" height="20" alt="scroll-to-top"/> </a> <script src="/js/jquery-1.7.1.min.js"></script> <script src="/js/jquery-ui-1.8.18.custom.min.js"></script> <script src="/js/jquery.defaultvalue.js"></script> <script src="/js/session.min.js"></script> <script src="/js/modernizr.js"></script> <script src="/js/modernize.js"></script> <script src="/js/application.min.js"></script> </div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10