CINXE.COM
Git - Maintaining a Project
<!DOCTYPE html> <html lang="be"> <head> <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 - Maintaining a Project</title> <link href="/favicon.ico" rel='shortcut icon' type='image/x-icon'> <link rel="stylesheet" href="/application.min.css"> <script src="/js/modernizr.js"></script> <script src="/js/modernize.js"></script> </head> <body id="documentation"> <div class="inner"> <header> <a href="/"><img src="/images/logo@2x.png" width="110" height="46" alt="Git" /></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> <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> </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">About</a> <ul> </ul> </li> <li> <a href="/doc" class="active">Documentation</a> <ul class="expanded"> <li> <a href="/docs">Reference</a> </li> <li> <a href="/book" class="active">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"> <p> This book is available in <a href="/book/en/v2/GitHub-Maintaining-a-Project">English</a>. </p> <p> Full translation available in <table> <tr><td><a href="/book/az/v2/GitHub-Bir-Layih%c9%99nin-Saxlan%c4%b1lmas%c4%b1">azərbaycan dili</a>,</td></tr> <tr><td><a href="/book/bg/v2/%d0%9d%d0%b0%d1%81%d1%82%d1%80%d0%be%d0%b9%d0%b2%d0%b0%d0%bd%d0%b5-%d0%bd%d0%b0-Git-Git-Hooks">български език</a>,</td></tr> <tr><td><a href="/book/de/v2/GitHub-Ein-Projekt-betreuen">Deutsch</a>,</td></tr> <tr><td><a href="/book/es/v2/GitHub-Mantenimiento-de-un-proyecto">Español</a>,</td></tr> <tr><td><a href="/book/fr/v2/GitHub-Maintenance-d%e2%80%99un-projet">Français</a>,</td></tr> <tr><td><a href="/book/gr">Ελληνικά</a>,</td></tr> <tr><td><a href="/book/ja/v2/GitHub-%e3%83%97%e3%83%ad%e3%82%b8%e3%82%a7%e3%82%af%e3%83%88%e3%81%ae%e3%83%a1%e3%83%b3%e3%83%86%e3%83%8a%e3%83%b3%e3%82%b9">日本語</a>,</td></tr> <tr><td><a href="/book/ko/v2/GitHub-GitHub-%ed%94%84%eb%a1%9c%ec%a0%9d%ed%8a%b8-%ea%b4%80%eb%a6%ac%ed%95%98%ea%b8%b0">한국어</a>,</td></tr> <tr><td><a href="/book/nl/v2/GitHub-Een-project-onderhouden">Nederlands</a>,</td></tr> <tr><td><a href="/book/ru/v2/GitHub-%d0%a1%d0%be%d0%bf%d1%80%d0%be%d0%b2%d0%be%d0%b6%d0%b4%d0%b5%d0%bd%d0%b8%d0%b5-%d0%bf%d1%80%d0%be%d0%b5%d0%ba%d1%82%d0%b0">Русский</a>,</td></tr> <tr><td><a href="/book/sl/v2/GitHub-Vzdr%c5%beevanje-projekta">Slovenščina</a>,</td></tr> <tr><td><a href="/book/tl/v2/GitHub-Pagpapanatili-ng-isang-Proyekto">Tagalog</a>,</td></tr> <tr><td><a href="/book/uk/v2/GitHub-%d0%a1%d1%83%d0%bf%d1%80%d0%be%d0%b2%d0%be%d0%b4%d0%b6%d1%83%d0%b2%d0%b0%d0%bd%d0%bd%d1%8f-%d0%bf%d1%80%d0%be%d1%94%d0%ba%d1%82%d1%83">Українська</a></td></tr> <tr><td><a href="/book/zh/v2/GitHub-%e7%bb%b4%e6%8a%a4%e9%a1%b9%e7%9b%ae">简体中文</a>,</td></tr> </table> </p> <p> Partial translations available in <table> <tr><td><a href="/book/cs/v2/GitHub-Maintaining-a-Project">Čeština</a>,</td></tr> <tr><td><a href="/book/mk/v2/GitHub-%d0%9e%d0%b4%d1%80%d0%b6%d1%83%d0%b2%d0%b0%d1%9a%d0%b5-%d0%bd%d0%b0-%d0%bf%d1%80%d0%be%d0%b5%d0%ba%d1%82">Македонски</a>,</td></tr> <tr><td><a href="/book/pl/v2/GitHub-Maintaining-a-Project">Polski</a>,</td></tr> <tr><td><a href="/book/sr/v2/GitHub-%d0%9e%d0%b4%d1%80%d0%b6%d0%b0%d0%b2%d0%b0%d1%9a%d0%b5-%d0%bf%d1%80%d0%be%d1%98%d0%b5%d0%ba%d1%82%d0%b0">Српски</a>,</td></tr> <tr><td><a href="/book/uz/v2/GitHub-Maintaining-a-Project">Ўзбекча</a>,</td></tr> <tr><td><a href="/book/zh-tw/v2/GitHub-%e7%b6%ad%e8%ad%b7%e5%b0%88%e6%a1%88">繁體中文</a>,</td></tr> </table> </p> <p> Translations started for <table> <tr><td><a href="/book/be/v2/GitHub-Maintaining-a-Project">Беларуская</a>,</td></tr> <tr><td><a href="/book/fa/v2/GitHub-Maintaining-a-Project" dir="rtl">فارسی</a>,</td></tr> <tr><td><a href="/book/id/v2/GitHub-Maintaining-a-Project">Indonesian</a>,</td></tr> <tr><td><a href="/book/it/v2/GitHub-Maintaining-a-Project">Italiano</a>,</td></tr> <tr><td><a href="/book/ms/v2/GitHub-Maintaining-a-Project">Bahasa Melayu</a>,</td></tr> <tr><td><a href="/book/pt-br/v2/GitHub-Maintaining-a-Project">Português (Brasil)</a>,</td></tr> <tr><td><a href="/book/pt-pt/v2/GitHub-Maintaining-a-Project">Português (Portugal)</a>,</td></tr> <tr><td><a href="/book/sv/v2/GitHub-Maintaining-a-Project">Svenska</a>,</td></tr> <tr><td><a href="/book/tr/v2/GitHub-Kurumsal-Y%c3%b6netim">Türkçe</a>.</td></tr> </table> </p> <hr class="sidebar"/> <p> The source of this book is <a href="https://github.com/progit/progit2-be">hosted on GitHub.</a></br> Patches, suggestions and comments are welcome. </p> </nav> </aside> <div id="content"> <div id="book-chapters"> <a class="dropdown-trigger" id="book-chapters-trigger" data-panel-id="chapters-dropdown" href="#">Chapters ▾</a> <div class='dropdown-panel' id='chapters-dropdown'> <div class='three-column'> <div class="column-left"> <ol class='book-toc'> <li class='chapter'> <h2>1. <a href="/book/be/v2/%d0%9f%d0%b5%d1%80%d1%88%d1%8b%d1%8f-%d0%ba%d1%80%d0%be%d0%ba%d1%96-About-Version-Control">Першыя крокі</a></h2> <ol> <li> 1.1 <a href="/book/be/v2/%d0%9f%d0%b5%d1%80%d1%88%d1%8b%d1%8f-%d0%ba%d1%80%d0%be%d0%ba%d1%96-About-Version-Control">About Version Control</a> </li> <li> 1.2 <a href="/book/be/v2/%d0%9f%d0%b5%d1%80%d1%88%d1%8b%d1%8f-%d0%ba%d1%80%d0%be%d0%ba%d1%96-A-Short-History-of-Git">A Short History of Git</a> </li> <li> 1.3 <a href="/book/be/v2/%d0%9f%d0%b5%d1%80%d1%88%d1%8b%d1%8f-%d0%ba%d1%80%d0%be%d0%ba%d1%96-What-is-Git%3F">What is Git?</a> </li> <li> 1.4 <a href="/book/be/v2/%d0%9f%d0%b5%d1%80%d1%88%d1%8b%d1%8f-%d0%ba%d1%80%d0%be%d0%ba%d1%96-The-Command-Line">The Command Line</a> </li> <li> 1.5 <a href="/book/be/v2/%d0%9f%d0%b5%d1%80%d1%88%d1%8b%d1%8f-%d0%ba%d1%80%d0%be%d0%ba%d1%96-Installing-Git">Installing Git</a> </li> <li> 1.6 <a href="/book/be/v2/%d0%9f%d0%b5%d1%80%d1%88%d1%8b%d1%8f-%d0%ba%d1%80%d0%be%d0%ba%d1%96-First-Time-Git-Setup">First-Time Git Setup</a> </li> <li> 1.7 <a href="/book/be/v2/%d0%9f%d0%b5%d1%80%d1%88%d1%8b%d1%8f-%d0%ba%d1%80%d0%be%d0%ba%d1%96-Getting-Help">Getting Help</a> </li> <li> 1.8 <a href="/book/be/v2/%d0%9f%d0%b5%d1%80%d1%88%d1%8b%d1%8f-%d0%ba%d1%80%d0%be%d0%ba%d1%96-%d0%9f%d0%b0%d0%b4%d1%81%d1%83%d0%bc%d0%b0%d0%b2%d0%b0%d0%bd%d1%8c%d0%bd%d0%b5">Падсумаваньне</a> </li> </ol> </li> <li class='chapter'> <h2>2. <a href="/book/be/v2/Git-Basics-Getting-a-Git-Repository">Git Basics</a></h2> <ol> <li> 2.1 <a href="/book/be/v2/Git-Basics-Getting-a-Git-Repository">Getting a Git Repository</a> </li> <li> 2.2 <a href="/book/be/v2/Git-Basics-Recording-Changes-to-the-Repository">Recording Changes to the Repository</a> </li> <li> 2.3 <a href="/book/be/v2/Git-Basics-Viewing-the-Commit-History">Viewing the Commit History</a> </li> <li> 2.4 <a href="/book/be/v2/Git-Basics-Undoing-Things">Undoing Things</a> </li> <li> 2.5 <a href="/book/be/v2/Git-Basics-Working-with-Remotes">Working with Remotes</a> </li> <li> 2.6 <a href="/book/be/v2/Git-Basics-Tagging">Tagging</a> </li> <li> 2.7 <a href="/book/be/v2/Git-Basics-Git-Aliases">Git Aliases</a> </li> <li> 2.8 <a href="/book/be/v2/Git-Basics-Summary">Summary</a> </li> </ol> </li> <li class='chapter'> <h2>3. <a href="/book/be/v2/Git-Branching-Branches-in-a-Nutshell">Git Branching</a></h2> <ol> <li> 3.1 <a href="/book/be/v2/Git-Branching-Branches-in-a-Nutshell">Branches in a Nutshell</a> </li> <li> 3.2 <a href="/book/be/v2/Git-Branching-Basic-Branching-and-Merging">Basic Branching and Merging</a> </li> <li> 3.3 <a href="/book/be/v2/Git-Branching-Branch-Management">Branch Management</a> </li> <li> 3.4 <a href="/book/be/v2/Git-Branching-Branching-Workflows">Branching Workflows</a> </li> <li> 3.5 <a href="/book/be/v2/Git-Branching-Remote-Branches">Remote Branches</a> </li> <li> 3.6 <a href="/book/be/v2/Git-Branching-Rebasing">Rebasing</a> </li> <li> 3.7 <a href="/book/be/v2/Git-Branching-Summary">Summary</a> </li> </ol> </li> <li class='chapter'> <h2>4. <a href="/book/be/v2/Git-on-the-Server-The-Protocols">Git on the Server</a></h2> <ol> <li> 4.1 <a href="/book/be/v2/Git-on-the-Server-The-Protocols">The Protocols</a> </li> <li> 4.2 <a href="/book/be/v2/Git-on-the-Server-Getting-Git-on-a-Server">Getting Git on a Server</a> </li> <li> 4.3 <a href="/book/be/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key">Generating Your SSH Public Key</a> </li> <li> 4.4 <a href="/book/be/v2/Git-on-the-Server-Setting-Up-the-Server">Setting Up the Server</a> </li> <li> 4.5 <a href="/book/be/v2/Git-on-the-Server-Git-Daemon">Git Daemon</a> </li> <li> 4.6 <a href="/book/be/v2/Git-on-the-Server-Smart-HTTP">Smart HTTP</a> </li> <li> 4.7 <a href="/book/be/v2/Git-on-the-Server-GitWeb">GitWeb</a> </li> <li> 4.8 <a href="/book/be/v2/Git-on-the-Server-GitLab">GitLab</a> </li> <li> 4.9 <a href="/book/be/v2/Git-on-the-Server-Third-Party-Hosted-Options">Third Party Hosted Options</a> </li> <li> 4.10 <a href="/book/be/v2/Git-on-the-Server-Summary">Summary</a> </li> </ol> </li> <li class='chapter'> <h2>5. <a href="/book/be/v2/Distributed-Git-Distributed-Workflows">Distributed Git</a></h2> <ol> <li> 5.1 <a href="/book/be/v2/Distributed-Git-Distributed-Workflows">Distributed Workflows</a> </li> <li> 5.2 <a href="/book/be/v2/Distributed-Git-Contributing-to-a-Project">Contributing to a Project</a> </li> <li> 5.3 <a href="/book/be/v2/Distributed-Git-Maintaining-a-Project">Maintaining a Project</a> </li> <li> 5.4 <a href="/book/be/v2/Distributed-Git-Summary">Summary</a> </li> </ol> </li> </ol> </div> <div class='column-middle'> <ol class='book-toc'> <li class='chapter'> <h2>6. <a href="/book/be/v2/GitHub-Account-Setup-and-Configuration">GitHub</a></h2> <ol> <li> 6.1 <a href="/book/be/v2/GitHub-Account-Setup-and-Configuration">Account Setup and Configuration</a> </li> <li> 6.2 <a href="/book/be/v2/GitHub-Contributing-to-a-Project">Contributing to a Project</a> </li> <li> 6.3 <a href="/book/be/v2/GitHub-Maintaining-a-Project" class="active">Maintaining a Project</a> </li> <li> 6.4 <a href="/book/be/v2/GitHub-Managing-an-organization">Managing an organization</a> </li> <li> 6.5 <a href="/book/be/v2/GitHub-Scripting-GitHub">Scripting GitHub</a> </li> <li> 6.6 <a href="/book/be/v2/GitHub-Summary">Summary</a> </li> </ol> </li> <li class='chapter'> <h2>7. <a href="/book/be/v2/Git-Tools-Revision-Selection">Git Tools</a></h2> <ol> <li> 7.1 <a href="/book/be/v2/Git-Tools-Revision-Selection">Revision Selection</a> </li> <li> 7.2 <a href="/book/be/v2/Git-Tools-Interactive-Staging">Interactive Staging</a> </li> <li> 7.3 <a href="/book/be/v2/Git-Tools-Stashing-and-Cleaning">Stashing and Cleaning</a> </li> <li> 7.4 <a href="/book/be/v2/Git-Tools-Signing-Your-Work">Signing Your Work</a> </li> <li> 7.5 <a href="/book/be/v2/Git-Tools-Searching">Searching</a> </li> <li> 7.6 <a href="/book/be/v2/Git-Tools-Rewriting-History">Rewriting History</a> </li> <li> 7.7 <a href="/book/be/v2/Git-Tools-Reset-Demystified">Reset Demystified</a> </li> <li> 7.8 <a href="/book/be/v2/Git-Tools-Advanced-Merging">Advanced Merging</a> </li> <li> 7.9 <a href="/book/be/v2/Git-Tools-Rerere">Rerere</a> </li> <li> 7.10 <a href="/book/be/v2/Git-Tools-Debugging-with-Git">Debugging with Git</a> </li> <li> 7.11 <a href="/book/be/v2/Git-Tools-Submodules">Submodules</a> </li> <li> 7.12 <a href="/book/be/v2/Git-Tools-Bundling">Bundling</a> </li> <li> 7.13 <a href="/book/be/v2/Git-Tools-Replace">Replace</a> </li> <li> 7.14 <a href="/book/be/v2/Git-Tools-Credential-Storage">Credential Storage</a> </li> <li> 7.15 <a href="/book/be/v2/Git-Tools-Summary">Summary</a> </li> </ol> </li> <li class='chapter'> <h2>8. <a href="/book/be/v2/Customizing-Git-Git-Configuration">Customizing Git</a></h2> <ol> <li> 8.1 <a href="/book/be/v2/Customizing-Git-Git-Configuration">Git Configuration</a> </li> <li> 8.2 <a href="/book/be/v2/Customizing-Git-Git-Attributes">Git Attributes</a> </li> <li> 8.3 <a href="/book/be/v2/Customizing-Git-Git-Hooks">Git Hooks</a> </li> <li> 8.4 <a href="/book/be/v2/Customizing-Git-An-Example-Git-Enforced-Policy">An Example Git-Enforced Policy</a> </li> <li> 8.5 <a href="/book/be/v2/Customizing-Git-Summary">Summary</a> </li> </ol> </li> <li class='chapter'> <h2>9. <a href="/book/be/v2/Git-and-Other-Systems-Git-as-a-Client">Git and Other Systems</a></h2> <ol> <li> 9.1 <a href="/book/be/v2/Git-and-Other-Systems-Git-as-a-Client">Git as a Client</a> </li> <li> 9.2 <a href="/book/be/v2/Git-and-Other-Systems-Migrating-to-Git">Migrating to Git</a> </li> <li> 9.3 <a href="/book/be/v2/Git-and-Other-Systems-Summary">Summary</a> </li> </ol> </li> <li class='chapter'> <h2>10. <a href="/book/be/v2/Git-Internals-Plumbing-and-Porcelain">Git Internals</a></h2> <ol> <li> 10.1 <a href="/book/be/v2/Git-Internals-Plumbing-and-Porcelain">Plumbing and Porcelain</a> </li> <li> 10.2 <a href="/book/be/v2/Git-Internals-Git-Objects">Git Objects</a> </li> <li> 10.3 <a href="/book/be/v2/Git-Internals-Git-References">Git References</a> </li> <li> 10.4 <a href="/book/be/v2/Git-Internals-Packfiles">Packfiles</a> </li> <li> 10.5 <a href="/book/be/v2/Git-Internals-The-Refspec">The Refspec</a> </li> <li> 10.6 <a href="/book/be/v2/Git-Internals-Transfer-Protocols">Transfer Protocols</a> </li> <li> 10.7 <a href="/book/be/v2/Git-Internals-Maintenance-and-Data-Recovery">Maintenance and Data Recovery</a> </li> <li> 10.8 <a href="/book/be/v2/Git-Internals-Environment-Variables">Environment Variables</a> </li> <li> 10.9 <a href="/book/be/v2/Git-Internals-Summary">Summary</a> </li> </ol> </li> </ol> </div> <div class='column-right'> <ol class='book-toc'> <li class='chapter'> <h2>A1. <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-A:-Git-in-Other-Environments-Graphical-Interfaces">Дадатак A: Git in Other Environments</a></h2> <ol> <li> A1.1 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-A:-Git-in-Other-Environments-Graphical-Interfaces">Graphical Interfaces</a> </li> <li> A1.2 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-A:-Git-in-Other-Environments-Git-in-Visual-Studio">Git in Visual Studio</a> </li> <li> A1.3 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-A:-Git-in-Other-Environments-Git-in-Visual-Studio-Code">Git in Visual Studio Code</a> </li> <li> A1.4 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-A:-Git-in-Other-Environments-Git-in-IntelliJ-/-PyCharm-/-WebStorm-/-PhpStorm-/-RubyMine">Git in IntelliJ / PyCharm / WebStorm / PhpStorm / RubyMine</a> </li> <li> A1.5 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-A:-Git-in-Other-Environments-Git-in-Sublime-Text">Git in Sublime Text</a> </li> <li> A1.6 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-A:-Git-in-Other-Environments-Git-in-Bash">Git in Bash</a> </li> <li> A1.7 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-A:-Git-in-Other-Environments-Git-in-Zsh">Git in Zsh</a> </li> <li> A1.8 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-A:-Git-in-Other-Environments-Git-in-PowerShell">Git in PowerShell</a> </li> <li> A1.9 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-A:-Git-in-Other-Environments-Summary">Summary</a> </li> </ol> </li> <li class='chapter'> <h2>A2. <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-B:-Embedding-Git-in-your-Applications-Command-line-Git">Дадатак B: Embedding Git in your Applications</a></h2> <ol> <li> A2.1 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-B:-Embedding-Git-in-your-Applications-Command-line-Git">Command-line Git</a> </li> <li> A2.2 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-B:-Embedding-Git-in-your-Applications-Libgit2">Libgit2</a> </li> <li> A2.3 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-B:-Embedding-Git-in-your-Applications-JGit">JGit</a> </li> <li> A2.4 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-B:-Embedding-Git-in-your-Applications-go-git">go-git</a> </li> <li> A2.5 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-B:-Embedding-Git-in-your-Applications-Dulwich">Dulwich</a> </li> </ol> </li> <li class='chapter'> <h2>A3. <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-C:-Git-Commands-Setup-and-Config">Дадатак C: Git Commands</a></h2> <ol> <li> A3.1 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-C:-Git-Commands-Setup-and-Config">Setup and Config</a> </li> <li> A3.2 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-C:-Git-Commands-Getting-and-Creating-Projects">Getting and Creating Projects</a> </li> <li> A3.3 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-C:-Git-Commands-Basic-Snapshotting">Basic Snapshotting</a> </li> <li> A3.4 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-C:-Git-Commands-Branching-and-Merging">Branching and Merging</a> </li> <li> A3.5 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-C:-Git-Commands-Sharing-and-Updating-Projects">Sharing and Updating Projects</a> </li> <li> A3.6 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-C:-Git-Commands-Inspection-and-Comparison">Inspection and Comparison</a> </li> <li> A3.7 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-C:-Git-Commands-Debugging">Debugging</a> </li> <li> A3.8 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-C:-Git-Commands-Patching">Patching</a> </li> <li> A3.9 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-C:-Git-Commands-Email">Email</a> </li> <li> A3.10 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-C:-Git-Commands-External-Systems">External Systems</a> </li> <li> A3.11 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-C:-Git-Commands-Administration">Administration</a> </li> <li> A3.12 <a href="/book/be/v2/%d0%94%d0%b0%d0%b4%d0%b0%d1%82%d0%b0%d0%ba-C:-Git-Commands-Plumbing-Commands">Plumbing Commands</a> </li> </ol> </li> </ol> </div> </div> </div> <span class="light" id="edition"> 2nd Edition </span> </div> <div id="main" data-pagefind-filter="category:book" data-pagefind-meta="category:Book" data-pagefind-weight="0.05" data-pagefind-body class="book edition2"> <h1>6.3 GitHub - Maintaining a Project</h1> <div> <h2 id="_maintaining_gh_project">Maintaining a Project</h2> <div class="paragraph"> <p>Now that we’re comfortable contributing to a project, let’s look at the other side: creating, maintaining and administering your own project.</p> </div> <div class="sect3"> <h3 id="_creating_a_new_repository">Creating a New Repository</h3> <div class="paragraph"> <p>Let’s create a new repository to share our project code with. Start by clicking the “New repository” button on the right-hand side of the dashboard, or from the <code>+</code> button in the top toolbar next to your username as seen in <a href="/book/be/v2/ch00/_new_repo_dropdown">The “New repository” dropdown</a>.</p> </div> <div class="imageblock"> <div class="content"> <img src="/book/be/v2/images/newrepo.png" alt="The “Your repositories” area"> </div> <div class="title">Малюнак 109. The “Your repositories” area</div> </div> <div id="_new_repo_dropdown" class="imageblock"> <div class="content"> <img src="/book/be/v2/images/new-repo.png" alt="The “new repository” dropdown"> </div> <div class="title">Малюнак 110. The “New repository” dropdown</div> </div> <div class="paragraph"> <p>This takes you to the “new repository” form:</p> </div> <div class="imageblock"> <div class="content"> <img src="/book/be/v2/images/newrepoform.png" alt="The “new repository” form"> </div> <div class="title">Малюнак 111. The “new repository” form</div> </div> <div class="paragraph"> <p>All you really have to do here is provide a project name; the rest of the fields are completely optional. For now, just click the “Create Repository” button, and boom – you have a new repository on GitHub, named <code><user>/<project_name></code>.</p> </div> <div class="paragraph"> <p>Since you have no code there yet, GitHub will show you instructions for how to create a brand-new Git repository, or connect an existing Git project. We won’t belabor this here; if you need a refresher, check out <a href="/book/be/v2/ch00/ch02-git-basics-chapter">Git Basics</a>.</p> </div> <div class="paragraph"> <p>Now that your project is hosted on GitHub, you can give the URL to anyone you want to share your project with. Every project on GitHub is accessible over HTTPS as <code>https://github.com/<user>/<project_name></code>, and over SSH as <code>git@github.com:<user>/<project_name></code>. Git can fetch from and push to both of these URLs, but they are access-controlled based on the credentials of the user connecting to them.</p> </div> <div class="admonitionblock note"> <table> <tr> <td class="icon"> <div class="title">Заўвага</div> </td> <td class="content"> <div class="paragraph"> <p>It is often preferable to share the HTTPS based URL for a public project, since the user does not have to have a GitHub account to access it for cloning. Users will have to have an account and an uploaded SSH key to access your project if you give them the SSH URL. The HTTPS one is also exactly the same URL they would paste into a browser to view the project there.</p> </div> </td> </tr> </table> </div> </div> <div class="sect3"> <h3 id="_adding_collaborators">Adding Collaborators</h3> <div class="paragraph"> <p>If you’re working with other people who you want to give commit access to, you need to add them as “collaborators”. If Ben, Jeff, and Louise all sign up for accounts on GitHub, and you want to give them push access to your repository, you can add them to your project. Doing so will give them “push” access, which means they have both read and write access to the project and Git repository.</p> </div> <div class="paragraph"> <p>Click the “Settings” link at the bottom of the right-hand sidebar.</p> </div> <div class="imageblock"> <div class="content"> <img src="/book/be/v2/images/reposettingslink.png" alt="The repository settings link"> </div> <div class="title">Малюнак 112. The repository settings link</div> </div> <div class="paragraph"> <p>Then select “Collaborators” from the menu on the left-hand side. Then, just type a username into the box, and click “Add collaborator.” You can repeat this as many times as you like to grant access to everyone you like. If you need to revoke access, just click the “X” on the right-hand side of their row.</p> </div> <div class="imageblock"> <div class="content"> <img src="/book/be/v2/images/collaborators.png" alt="The repository collaborators box"> </div> <div class="title">Малюнак 113. Repository collaborators</div> </div> </div> <div class="sect3"> <h3 id="_managing_pull_requests">Managing Pull Requests</h3> <div class="paragraph"> <p>Now that you have a project with some code in it and maybe even a few collaborators who also have push access, let’s go over what to do when you get a Pull Request yourself.</p> </div> <div class="paragraph"> <p>Pull Requests can either come from a branch in a fork of your repository or they can come from another branch in the same repository. The only difference is that the ones in a fork are often from people where you can’t push to their branch and they can’t push to yours, whereas with internal Pull Requests generally both parties can access the branch.</p> </div> <div class="paragraph"> <p>For these examples, let’s assume you are “tonychacon” and you’ve created a new Arduino code project named “fade”.</p> </div> <div class="sect4"> <h4 id="_email_notifications">Email Notifications</h4> <div class="paragraph"> <p>Someone comes along and makes a change to your code and sends you a Pull Request. You should get an email notifying you about the new Pull Request and it should look something like <a href="/book/be/v2/ch00/_email_pr">Email notification of a new Pull Request</a>.</p> </div> <div id="_email_pr" class="imageblock"> <div class="content"> <img src="/book/be/v2/images/maint-01-email.png" alt="Pull Request email notification"> </div> <div class="title">Малюнак 114. Email notification of a new Pull Request</div> </div> <div class="paragraph"> <p>There are a few things to notice about this email. It will give you a small diffstat — a list of files that have changed in the Pull Request and by how much. It gives you a link to the Pull Request on GitHub. It also gives you a few URLs that you can use from the command line.</p> </div> <div class="paragraph"> <p>If you notice the line that says <code>git pull <url> patch-1</code>, this is a simple way to merge in a remote branch without having to add a remote. We went over this quickly in <a href="/book/be/v2/ch00/_checking_out_remotes">Checking Out Remote Branches</a>. If you wish, you can create and switch to a topic branch and then run this command to merge in the Pull Request changes.</p> </div> <div class="paragraph"> <p>The other interesting URLs are the <code>.diff</code> and <code>.patch</code> URLs, which as you may guess, provide unified diff and patch versions of the Pull Request. You could technically merge in the Pull Request work with something like this:</p> </div> <div class="listingblock"> <div class="content"> <pre class="highlight"><code class="language-console" data-lang="console">$ curl https://github.com/tonychacon/fade/pull/1.patch | git am</code></pre> </div> </div> </div> <div class="sect4"> <h4 id="_collaborating_on_the_pull_request">Collaborating on the Pull Request</h4> <div class="paragraph"> <p>As we covered in <a href="/book/be/v2/ch00/ch06-github_flow">The GitHub Flow</a>, you can now have a conversation with the person who opened the Pull Request. You can comment on specific lines of code, comment on whole commits or comment on the entire Pull Request itself, using GitHub Flavored Markdown everywhere.</p> </div> <div class="paragraph"> <p>Every time someone else comments on the Pull Request you will continue to get email notifications so you know there is activity happening. They will each have a link to the Pull Request where the activity is happening and you can also directly respond to the email to comment on the Pull Request thread.</p> </div> <div class="imageblock"> <div class="content"> <img src="/book/be/v2/images/maint-03-email-resp.png" alt="Email response"> </div> <div class="title">Малюнак 115. Responses to emails are included in the thread</div> </div> <div class="paragraph"> <p>Once the code is in a place you like and want to merge it in, you can either pull the code down and merge it locally, either with the <code>git pull <url> <branch></code> syntax we saw earlier, or by adding the fork as a remote and fetching and merging.</p> </div> <div class="paragraph"> <p>If the merge is trivial, you can also just hit the “Merge” button on the GitHub site. This will do a “non-fast-forward” merge, creating a merge commit even if a fast-forward merge was possible. This means that no matter what, every time you hit the merge button, a merge commit is created. As you can see in <a href="/book/be/v2/ch00/_merge_button">Merge button and instructions for merging a Pull Request manually</a>, GitHub gives you all of this information if you click the hint link.</p> </div> <div id="_merge_button" class="imageblock"> <div class="content"> <img src="/book/be/v2/images/maint-02-merge.png" alt="Merge button"> </div> <div class="title">Малюнак 116. Merge button and instructions for merging a Pull Request manually</div> </div> <div class="paragraph"> <p>If you decide you don’t want to merge it, you can also just close the Pull Request and the person who opened it will be notified.</p> </div> </div> <div class="sect4"> <h4 id="_pr_refs">Pull Request Refs</h4> <div class="paragraph"> <p>If you’re dealing with a <strong>lot</strong> of Pull Requests and don’t want to add a bunch of remotes or do one time pulls every time, there is a neat trick that GitHub allows you to do. This is a bit of an advanced trick and we’ll go over the details of this a bit more in <a href="/book/be/v2/ch00/_refspec">The Refspec</a>, but it can be pretty useful.</p> </div> <div class="paragraph"> <p>GitHub actually advertises the Pull Request branches for a repository as sort of pseudo-branches on the server. By default you don’t get them when you clone, but they are there in an obscured way and you can access them pretty easily.</p> </div> <div class="paragraph"> <p>To demonstrate this, we’re going to use a low-level command (often referred to as a “plumbing” command, which we’ll read about more in <a href="/book/be/v2/ch00/_plumbing_porcelain">Plumbing and Porcelain</a>) called <code>ls-remote</code>. This command is generally not used in day-to-day Git operations but it’s useful to show us what references are present on the server.</p> </div> <div class="paragraph"> <p>If we run this command against the “blink” repository we were using earlier, we will get a list of all the branches and tags and other references in the repository.</p> </div> <div class="listingblock"> <div class="content"> <pre class="highlight"><code class="language-console" data-lang="console">$ git ls-remote https://github.com/schacon/blink 10d539600d86723087810ec636870a504f4fee4d HEAD 10d539600d86723087810ec636870a504f4fee4d refs/heads/master 6a83107c62950be9453aac297bb0193fd743cd6e refs/pull/1/head afe83c2d1a70674c9505cc1d8b7d380d5e076ed3 refs/pull/1/merge 3c8d735ee16296c242be7a9742ebfbc2665adec1 refs/pull/2/head 15c9f4f80973a2758462ab2066b6ad9fe8dcf03d refs/pull/2/merge a5a7751a33b7e86c5e9bb07b26001bb17d775d1a refs/pull/4/head 31a45fc257e8433c8d8804e3e848cf61c9d3166c refs/pull/4/merge</code></pre> </div> </div> <div class="paragraph"> <p>Of course, if you’re in your repository and you run <code>git ls-remote origin</code> or whatever remote you want to check, it will show you something similar to this.</p> </div> <div class="paragraph"> <p>If the repository is on GitHub and you have any Pull Requests that have been opened, you’ll get these references that are prefixed with <code>refs/pull/</code>. These are basically branches, but since they’re not under <code>refs/heads/</code> you don’t get them normally when you clone or fetch from the server — the process of fetching ignores them normally.</p> </div> <div class="paragraph"> <p>There are two references per Pull Request - the one that ends in <code>/head</code> points to exactly the same commit as the last commit in the Pull Request branch. So if someone opens a Pull Request in our repository and their branch is named <code>bug-fix</code> and it points to commit <code>a5a775</code>, then in <strong>our</strong> repository we will not have a <code>bug-fix</code> branch (since that’s in their fork), but we <em>will</em> have <code>pull/<pr#>/head</code> that points to <code>a5a775</code>. This means that we can pretty easily pull down every Pull Request branch in one go without having to add a bunch of remotes.</p> </div> <div class="paragraph"> <p>Now, you could do something like fetching the reference directly.</p> </div> <div class="listingblock"> <div class="content"> <pre class="highlight"><code class="language-console" data-lang="console">$ git fetch origin refs/pull/958/head From https://github.com/libgit2/libgit2 * branch refs/pull/958/head -> FETCH_HEAD</code></pre> </div> </div> <div class="paragraph"> <p>This tells Git, “Connect to the <code>origin</code> remote, and download the ref named <code>refs/pull/958/head</code>.” Git happily obeys, and downloads everything you need to construct that ref, and puts a pointer to the commit you want under <code>.git/FETCH_HEAD</code>. You can follow that up with <code>git merge FETCH_HEAD</code> into a branch you want to test it in, but that merge commit message looks a bit weird. Also, if you’re reviewing a <strong>lot</strong> of pull requests, this gets tedious.</p> </div> <div class="paragraph"> <p>There’s also a way to fetch <em>all</em> of the pull requests, and keep them up to date whenever you connect to the remote. Open up <code>.git/config</code> in your favorite editor, and look for the <code>origin</code> remote. It should look a bit like this:</p> </div> <div class="listingblock"> <div class="content"> <pre class="highlight"><code class="language-ini" data-lang="ini">[remote "origin"] url = https://github.com/libgit2/libgit2 fetch = +refs/heads/*:refs/remotes/origin/*</code></pre> </div> </div> <div class="paragraph"> <p>That line that begins with <code>fetch =</code> is a “refspec.” It’s a way of mapping names on the remote with names in your local <code>.git</code> directory. This particular one tells Git, "the things on the remote that are under <code>refs/heads</code> should go in my local repository under <code>refs/remotes/origin</code>." You can modify this section to add another refspec:</p> </div> <div class="listingblock"> <div class="content"> <pre class="highlight"><code class="language-ini" data-lang="ini">[remote "origin"] url = https://github.com/libgit2/libgit2.git fetch = +refs/heads/*:refs/remotes/origin/* fetch = +refs/pull/*/head:refs/remotes/origin/pr/*</code></pre> </div> </div> <div class="paragraph"> <p>That last line tells Git, “All the refs that look like <code>refs/pull/123/head</code> should be stored locally like <code>refs/remotes/origin/pr/123</code>.” Now, if you save that file, and do a <code>git fetch</code>:</p> </div> <div class="listingblock"> <div class="content"> <pre class="highlight"><code class="language-console" data-lang="console">$ git fetch # … * [new ref] refs/pull/1/head -> origin/pr/1 * [new ref] refs/pull/2/head -> origin/pr/2 * [new ref] refs/pull/4/head -> origin/pr/4 # …</code></pre> </div> </div> <div class="paragraph"> <p>Now all of the remote pull requests are represented locally with refs that act much like tracking branches; they’re read-only, and they update when you do a fetch. This makes it super easy to try the code from a pull request locally:</p> </div> <div class="listingblock"> <div class="content"> <pre class="highlight"><code class="language-console" data-lang="console">$ git checkout pr/2 Checking out files: 100% (3769/3769), done. Branch pr/2 set up to track remote branch pr/2 from origin. Switched to a new branch 'pr/2'</code></pre> </div> </div> <div class="paragraph"> <p>The eagle-eyed among you would note the <code>head</code> on the end of the remote portion of the refspec. There’s also a <code>refs/pull/#/merge</code> ref on the GitHub side, which represents the commit that would result if you push the “merge” button on the site. This can allow you to test the merge before even hitting the button.</p> </div> </div> <div class="sect4"> <h4 id="_pull_requests_on_pull_requests">Pull Requests on Pull Requests</h4> <div class="paragraph"> <p>Not only can you open Pull Requests that target the main or <code>master</code> branch, you can actually open a Pull Request targeting any branch in the network. In fact, you can even target another Pull Request.</p> </div> <div class="paragraph"> <p>If you see a Pull Request that is moving in the right direction and you have an idea for a change that depends on it or you’re not sure is a good idea, or you just don’t have push access to the target branch, you can open a Pull Request directly to it.</p> </div> <div class="paragraph"> <p>When you go to open a Pull Request, there is a box at the top of the page that specifies which branch you’re requesting to pull to and which you’re requesting to pull from. If you hit the “Edit” button at the right of that box you can change not only the branches but also which fork.</p> </div> <div id="_pr_targets" class="imageblock"> <div class="content"> <img src="/book/be/v2/images/maint-04-target.png" alt="PR targets"> </div> <div class="title">Малюнак 117. Manually change the Pull Request target fork and branch</div> </div> <div class="paragraph"> <p>Here you can fairly easily specify to merge your new branch into another Pull Request or another fork of the project.</p> </div> </div> </div> <div class="sect3"> <h3 id="_mentions_and_notifications">Mentions and Notifications</h3> <div class="paragraph"> <p>GitHub also has a pretty nice notifications system built in that can come in handy when you have questions or need feedback from specific individuals or teams.</p> </div> <div class="paragraph"> <p>In any comment you can start typing a <code>@</code> character and it will begin to autocomplete with the names and usernames of people who are collaborators or contributors in the project.</p> </div> <div class="imageblock"> <div class="content"> <img src="/book/be/v2/images/maint-05-mentions.png" alt="Mentions"> </div> <div class="title">Малюнак 118. Start typing @ to mention someone</div> </div> <div class="paragraph"> <p>You can also mention a user who is not in that dropdown, but often the autocompleter can make it faster.</p> </div> <div class="paragraph"> <p>Once you post a comment with a user mention, that user will be notified. This means that this can be a really effective way of pulling people into conversations rather than making them poll. Very often in Pull Requests on GitHub people will pull in other people on their teams or in their company to review an Issue or Pull Request.</p> </div> <div class="paragraph"> <p>If someone gets mentioned on a Pull Request or Issue, they will be “subscribed” to it and will continue getting notifications any time some activity occurs on it. You will also be subscribed to something if you opened it, if you’re watching the repository or if you comment on something. If you no longer wish to receive notifications, there is an “Unsubscribe” button on the page you can click to stop receiving updates on it.</p> </div> <div class="imageblock"> <div class="content"> <img src="/book/be/v2/images/maint-06-unsubscribe.png" alt="Unsubscribe"> </div> <div class="title">Малюнак 119. Unsubscribe from an Issue or Pull Request</div> </div> <div class="sect4"> <h4 id="_the_notifications_page">The Notifications Page</h4> <div class="paragraph"> <p>When we mention “notifications” here with respect to GitHub, we mean a specific way that GitHub tries to get in touch with you when events happen and there are a few different ways you can configure them. If you go to the “Notification center” tab from the settings page, you can see some of the options you have.</p> </div> <div class="imageblock"> <div class="content"> <img src="/book/be/v2/images/maint-07-notifications.png" alt="Notification center"> </div> <div class="title">Малюнак 120. Notification center options</div> </div> <div class="paragraph"> <p>The two choices are to get notifications over “Email” and over “Web” and you can choose either, neither or both for when you actively participate in things and for activity on repositories you are watching.</p> </div> <div class="sect5"> <h6 id="_web_notifications">Web Notifications</h6> <div class="paragraph"> <p>Web notifications only exist on GitHub and you can only check them on GitHub. If you have this option selected in your preferences and a notification is triggered for you, you will see a small blue dot over your notifications icon at the top of your screen as seen in <a href="/book/be/v2/ch00/_not_center">Notification center</a>.</p> </div> <div id="_not_center" class="imageblock"> <div class="content"> <img src="/book/be/v2/images/maint-08-notifications-page.png" alt="Notification center"> </div> <div class="title">Малюнак 121. Notification center</div> </div> <div class="paragraph"> <p>If you click on that, you will see a list of all the items you have been notified about, grouped by project. You can filter to the notifications of a specific project by clicking on its name in the left hand sidebar. You can also acknowledge the notification by clicking the checkmark icon next to any notification, or acknowledge <em>all</em> of the notifications in a project by clicking the checkmark at the top of the group. There is also a mute button next to each checkmark that you can click to not receive any further notifications on that item.</p> </div> <div class="paragraph"> <p>All of these tools are very useful for handling large numbers of notifications. Many GitHub power users will simply turn off email notifications entirely and manage all of their notifications through this screen.</p> </div> </div> <div class="sect5"> <h6 id="_email_notifications_2">Email Notifications</h6> <div class="paragraph"> <p>Email notifications are the other way you can handle notifications through GitHub. If you have this turned on you will get emails for each notification. We saw examples of this in <a href="/book/be/v2/ch00/_email_notification">Comments sent as email notifications</a> and <a href="/book/be/v2/ch00/_email_pr">Email notification of a new Pull Request</a>. The emails will also be threaded properly, which is nice if you’re using a threading email client.</p> </div> <div class="paragraph"> <p>There is also a fair amount of metadata embedded in the headers of the emails that GitHub sends you, which can be really helpful for setting up custom filters and rules.</p> </div> <div class="paragraph"> <p>For instance, if we look at the actual email headers sent to Tony in the email shown in <a href="/book/be/v2/ch00/_email_pr">Email notification of a new Pull Request</a>, we will see the following among the information sent:</p> </div> <div class="listingblock"> <div class="content"> <pre class="highlight"><code class="language-mbox" data-lang="mbox">To: tonychacon/fade <fade@noreply.github.com> Message-ID: <tonychacon/fade/pull/1@github.com> Subject: [fade] Wait longer to see the dimming effect better (#1) X-GitHub-Recipient: tonychacon List-ID: tonychacon/fade <fade.tonychacon.github.com> List-Archive: https://github.com/tonychacon/fade List-Post: <mailto:reply+i-4XXX@reply.github.com> List-Unsubscribe: <mailto:unsub+i-XXX@reply.github.com>,... X-GitHub-Recipient-Address: tchacon@example.com</code></pre> </div> </div> <div class="paragraph"> <p>There are a couple of interesting things here. If you want to highlight or re-route emails to this particular project or even Pull Request, the information in <code>Message-ID</code> gives you all the data in <code><user>/<project>/<type>/<id></code> format. If this were an issue, for example, the <code><type></code> field would have been “issues” rather than “pull”.</p> </div> <div class="paragraph"> <p>The <code>List-Post</code> and <code>List-Unsubscribe</code> fields mean that if you have a mail client that understands those, you can easily post to the list or “Unsubscribe” from the thread. That would be essentially the same as clicking the “mute” button on the web version of the notification or “Unsubscribe” on the Issue or Pull Request page itself.</p> </div> <div class="paragraph"> <p>It’s also worth noting that if you have both email and web notifications enabled and you read the email version of the notification, the web version will be marked as read as well if you have images allowed in your mail client.</p> </div> </div> </div> </div> <div class="sect3"> <h3 id="_special_files">Special Files</h3> <div class="paragraph"> <p>There are a couple of special files that GitHub will notice if they are present in your repository.</p> </div> </div> <div class="sect3"> <h3 id="_readme">README</h3> <div class="paragraph"> <p>The first is the <code>README</code> file, which can be of nearly any format that GitHub recognizes as prose. For example, it could be <code>README</code>, <code>README.md</code>, <code>README.asciidoc</code>, etc. If GitHub sees a README file in your source, it will render it on the landing page of the project.</p> </div> <div class="paragraph"> <p>Many teams use this file to hold all the relevant project information for someone who might be new to the repository or project. This generally includes things like:</p> </div> <div class="ulist"> <ul> <li> <p>What the project is for</p> </li> <li> <p>How to configure and install it</p> </li> <li> <p>An example of how to use it or get it running</p> </li> <li> <p>The license that the project is offered under</p> </li> <li> <p>How to contribute to it</p> </li> </ul> </div> <div class="paragraph"> <p>Since GitHub will render this file, you can embed images or links in it for added ease of understanding.</p> </div> </div> <div class="sect3"> <h3 id="_contributing">CONTRIBUTING</h3> <div class="paragraph"> <p>The other special file that GitHub recognizes is the <code>CONTRIBUTING</code> file. If you have a file named <code>CONTRIBUTING</code> with any file extension, GitHub will show <a href="/book/be/v2/ch00/_contrib_file">Opening a Pull Request when a CONTRIBUTING file exists</a> when anyone starts opening a Pull Request.</p> </div> <div id="_contrib_file" class="imageblock"> <div class="content"> <img src="/book/be/v2/images/maint-09-contrib.png" alt="Contributing notice"> </div> <div class="title">Малюнак 122. Opening a Pull Request when a CONTRIBUTING file exists</div> </div> <div class="paragraph"> <p>The idea here is that you can specify specific things you want or don’t want in a Pull Request sent to your project. This way people may actually read the guidelines before opening the Pull Request.</p> </div> </div> <div class="sect3"> <h3 id="_project_administration">Project Administration</h3> <div class="paragraph"> <p>Generally there are not a lot of administrative things you can do with a single project, but there are a couple of items that might be of interest.</p> </div> <div class="sect4"> <h4 id="_changing_the_default_branch">Changing the Default Branch</h4> <div class="paragraph"> <p>If you are using a branch other than “master” as your default branch that you want people to open Pull Requests on or see by default, you can change that in your repository’s settings page under the “Options” tab.</p> </div> <div id="_default_branch" class="imageblock"> <div class="content"> <img src="/book/be/v2/images/maint-10-default-branch.png" alt="Default branch"> </div> <div class="title">Малюнак 123. Change the default branch for a project</div> </div> <div class="paragraph"> <p>Simply change the default branch in the dropdown and that will be the default for all major operations from then on, including which branch is checked out by default when someone clones the repository.</p> </div> </div> <div class="sect4"> <h4 id="_transferring_a_project">Transferring a Project</h4> <div class="paragraph"> <p>If you would like to transfer a project to another user or an organization in GitHub, there is a “Transfer ownership” option at the bottom of the same “Options” tab of your repository settings page that allows you to do this.</p> </div> <div id="_transfer_project" class="imageblock"> <div class="content"> <img src="/book/be/v2/images/maint-11-transfer.png" alt="Transfer"> </div> <div class="title">Малюнак 124. Transfer a project to another GitHub user or Organization</div> </div> <div class="paragraph"> <p>This is helpful if you are abandoning a project and someone wants to take it over, or if your project is getting bigger and want to move it into an organization.</p> </div> <div class="paragraph"> <p>Not only does this move the repository along with all its watchers and stars to another place, it also sets up a redirect from your URL to the new place. It will also redirect clones and fetches from Git, not just web requests.</p> </div> </div> </div> <div id="nav"><a href="/book/be/v2/GitHub-Contributing-to-a-Project">prev</a> | <a href="/book/be/v2/GitHub-Managing-an-organization">next</a></div> </div> </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/application.min.js"></script> </div> </body> </html>