CINXE.COM

WesnothRepository - The Battle for Wesnoth Wiki

<!DOCTYPE html> <html class="client-nojs" lang="en" dir="ltr"> <head> <meta charset="UTF-8"/> <title>WesnothRepository - The Battle for Wesnoth Wiki</title> <script>document.documentElement.className = document.documentElement.className.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" );</script> <script>(window.RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"WesnothRepository","wgTitle":"WesnothRepository","wgCurRevisionId":73257,"wgRevisionId":73257,"wgArticleId":1570,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Development"],"wgBreakFrames":false,"wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgRelevantPageName":"WesnothRepository","wgRelevantArticleId":1570,"wgRequestId":"bcd83ceb37a088fa044e252b","wgIsProbablyEditable":false,"wgRelevantPageIsProbablyEditable":false,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgWikiEditorEnabledModules":[]});mw.loader.state({"site.styles":"ready","noscript":"ready","user.styles":"ready","user":"ready","user.options":"ready","user.tokens":"loading","ext.CookieWarning.styles":"ready","mediawiki.legacy.shared":"ready","mediawiki.legacy.commonPrint":"ready","mediawiki.sectionAnchor":"ready"});mw.loader.implement("user.tokens@15y0z4f",function($,jQuery,require,module){/*@nomin*/mw.user.tokens.set({"editToken":"+\\","patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); });mw.loader.load(["site","mediawiki.page.startup","mediawiki.user","mediawiki.hidpi","mediawiki.page.ready","mediawiki.toc","mediawiki.searchSuggest","ext.CookieWarning","skins.wesmere.js"]);});</script> <link rel="stylesheet" href="/load.php?debug=false&amp;lang=en&amp;modules=ext.CookieWarning.styles%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.sectionAnchor&amp;only=styles&amp;skin=Wesmere"/> <script async="" src="/load.php?debug=false&amp;lang=en&amp;modules=startup&amp;only=scripts&amp;skin=Wesmere"></script> <meta name="ResourceLoaderDynamicStyles" content=""/> <link rel="stylesheet" href="/load.php?debug=false&amp;lang=en&amp;modules=site.styles&amp;only=styles&amp;skin=Wesmere"/> <meta name="generator" content="MediaWiki 1.31.16"/> <meta name="description" content="The Battle for Wesnoth code-base is stored in a version control repository. Version control allows the entire development team to edit files concurrently. The version control software tracks revisions, stores a record of all edits, and prevents simultaneous editing from causing clashes. All changes are stored in the version control repository."/> <link rel="shortcut icon" href="/favicon.ico"/> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch_desc.php" title="The Battle for Wesnoth Wiki (en)"/> <link rel="EditURI" type="application/rsd+xml" href="https://wiki.wesnoth.org/api.php?action=rsd"/> <link rel="alternate" type="application/atom+xml" title="The Battle for Wesnoth Wiki Atom feed" href="/index.php?title=Special:RecentChanges&amp;feed=atom"/> <meta name="viewport" content="width=device-width,initial-scale=1" /> <link rel="stylesheet" type="text/css" href="https://www.wesnoth.org/wesmere/css/wesmere-1.2.0.css" /> <script src="https://www.wesnoth.org/wesmere/js/modernizr.js"></script> <link rel="apple-touch-icon" type="image/png" href="https://www.wesnoth.org/wesmere/img/apple-touch-icon.png" sizes="180x180" /> <link rel="icon" type="image/png" href="https://www.wesnoth.org/wesmere/img/favicon-32.png" sizes="32x32" /> <link rel="icon" type="image/png" href="https://www.wesnoth.org/wesmere/img/favicon-16.png" sizes="16x16" /> <meta name="theme-color" content="#0f1421" /> <!--[if lt IE 9]><script src="/load.php?debug=false&amp;lang=en&amp;modules=html5shiv&amp;only=scripts&amp;skin=Wesmere&amp;sync=1"></script><![endif]--> </head> <body class="mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-WesnothRepository rootpage-WesnothRepository skin-Wesmere action-view"><div class="mw-cookiewarning-container"><div class="mw-cookiewarning-text"><span>Cookies help us deliver our services. By using our services, you agree to our use of cookies.</span><form method="POST"><input name="disablecookiewarning" class="mw-cookiewarning-dismiss" type="submit" value="OK"/></form></div></div> <div id="main"> <div id="nav" role="banner"> <div class="centerbox"> <div id="logo"> <a href="https://www.wesnoth.org/" aria-label="Wesnoth logo"></a> </div> <ul id="navlinks"> <li><a href="https://www.wesnoth.org/">Home</a></li> <li><a href="https://forums.wesnoth.org/viewforum.php?f=62">News</a></li> <li><a href="https://wiki.wesnoth.org/Play">Play</a></li> <li><a href="https://wiki.wesnoth.org/Create">Create</a></li> <li><a href="https://forums.wesnoth.org/">Forums</a></li> <li><a href="https://wiki.wesnoth.org/Project">About</a></li> </ul> <div id="sitesearch" role="search"> <form method="get" action="/index.php"> <input id="searchbox" type="search" name="search" placeholder="Search" value="" title="Search this wiki [Alt+Shift+f]" accesskey="f" /> <span id="searchbox-controls"> <button id="search-go" class="search-button" type="submit" title="Search"> <i class="search-icon" aria-hidden="true"></i> <span class="sr-label">Search this wiki</span> </button> </span> </form> </div> <div class="reset"></div> </div> </div> <div id="content" class="mw-content" role="main"> <a id="top"></a> <div id="wm-wiki-toolbar" role="toolbar"><ul class="wm-toolbar" role="toolbar" aria-label="Wiki"><li id="ca-nstab-main" class="selected"><a href="/WesnothRepository" role="button" title="View the content page [c]" accesskey="c"><i class="wm-toolbar-icon" aria-hidden="true"></i><span class="sr-label">Page</span></a></li><li id="ca-talk" class="new"><a href="/index.php?title=Talk:WesnothRepository&amp;action=edit&amp;redlink=1" rel="discussion" role="button" title="Discussion about the content page (page does not exist) [t]" accesskey="t"><i class="wm-toolbar-icon" aria-hidden="true"></i><span class="sr-label">Discussion</span></a></li><li id="ca-history"><a href="/index.php?title=WesnothRepository&amp;action=history" role="button" title="Past revisions of this page [h]" accesskey="h"><i class="wm-toolbar-icon" aria-hidden="true"></i><span class="sr-label">History</span></a></li><li id="wm-places-menu" class="wm-dropdown"><a class="wm-dropdown-trigger" href="#" title="Places" role="button"><i class="wm-toolbar-icon" aria-hidden="true"></i><span class="sr-label">Places</span><i class="wm-toolbar-dropdown-marker" aria-hidden="true"></i></a><ul class="wm-dropdown-menu" role="menu"><li id="n-mainpage-description"><a href="/Main_Page" role="menuitem" title="Visit the main page [z]" accesskey="z"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>Main page</span></a></li><li id="n-recentchanges"><a href="/Special:RecentChanges" role="menuitem" title="A list of recent changes in the wiki [r]" accesskey="r"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>Recent changes</span></a></li><li id="n-randompage"><a href="/Special:Random" role="menuitem" title="Load a random page [x]" accesskey="x"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>Random page</span></a></li><li id="n-help-mediawiki"><a href="https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents" role="menuitem"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>Help about MediaWiki</span></a></li></ul><li id="wm-advanced-menu" class="wm-dropdown"><a class="wm-dropdown-trigger" href="#" title="Advanced" role="button"><i class="wm-toolbar-icon" aria-hidden="true"></i><span class="sr-label">Advanced</span><i class="wm-toolbar-dropdown-marker" aria-hidden="true"></i></a><ul class="wm-dropdown-menu" role="menu"><li id="ca-viewsource"><a href="/index.php?title=WesnothRepository&amp;action=edit" role="menuitem" title="This page is protected.&#10;You can view its source [e]" accesskey="e"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>View source</span></a></li><li id="t-whatlinkshere"><a href="/Special:WhatLinksHere/WesnothRepository" role="menuitem" title="A list of all wiki pages that link here [j]" accesskey="j"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>What links here</span></a></li><li id="t-recentchangeslinked"><a href="/Special:RecentChangesLinked/WesnothRepository" rel="nofollow" role="menuitem" title="Recent changes in pages linked from this page [k]" accesskey="k"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>Related changes</span></a></li><li id="t-specialpages"><a href="/Special:SpecialPages" role="menuitem" title="A list of all special pages [q]" accesskey="q"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>Special pages</span></a></li><li id="t-permalink"><a href="/index.php?title=WesnothRepository&amp;oldid=73257" role="menuitem" title="Permanent link to this revision of the page"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>Permanent link</span></a></li><li id="t-info"><a href="/index.php?title=WesnothRepository&amp;action=info" role="menuitem" title="More information about this page"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>Page information</span></a></li></ul></ul><ul class="wm-toolbar" role="toolbar" aria-label="User"><li id="wm-account-menu" class="wm-dropdown"><a class="wm-dropdown-trigger" href="#" title="Your account" role="button"><i class="wm-toolbar-icon" aria-hidden="true"></i><span class="sr-label">Not logged in</span><i class="wm-toolbar-dropdown-marker" aria-hidden="true"></i></a><ul class="wm-dropdown-menu" role="menu"><li id="pt-login"><a href="/index.php?title=Special:UserLogin&amp;returnto=WesnothRepository" role="menuitem" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o"><i class="wm-toolbar-icon" aria-hidden="true"></i><span>Log in</span></a></li></ul></ul></div> <!-- wm-wiki-toolbar --> <h1 class="firstHeading" lang="en">WesnothRepository</h1> <div id="bodyContent"> <div id="siteSub">From The Battle for Wesnoth Wiki</div> <div id="contentSub"></div> <!-- start wikipage --> <div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><div class="mw-parser-output"><table class="reference-sidebar"> <tbody><tr> <td> <p><span class="editlink">&#91;<a rel="nofollow" class="external text" href="https://wiki.wesnoth.org/index.php?title=Template:Compiling_Wesnoth&amp;action=edit">edit</a>&#93;</span><b>Compiling Wesnoth</b> </p> </td></tr> <tr> <td>Platforms <ul><li><a rel="nofollow" class="external text" href="https://github.com/wesnoth/wesnoth/blob/master/INSTALL.md">Linux or Unix</a></li> <li>macOS [<a rel="nofollow" class="external text" href="https://github.com/wesnoth/wesnoth/blob/1.14/projectfiles/Xcode/README.md">1.14</a>, <a rel="nofollow" class="external text" href="https://github.com/wesnoth/wesnoth/blob/master/projectfiles/Xcode/README.md">master</a>]</li> <li>Windows [<a rel="nofollow" class="external text" href="https://github.com/wesnoth/wesnoth/blob/1.14/projectfiles/VC16/README.md">1.14 (VS2019)</a>, <a rel="nofollow" class="external text" href="https://github.com/wesnoth/wesnoth/blob/master/projectfiles/VC14/README.md">master (VS2015/VS2017)</a>, <a rel="nofollow" class="external text" href="https://github.com/wesnoth/wesnoth/blob/master/projectfiles/VC16/README.md">master (VS2019)</a>]</li></ul> </td></tr></tbody></table> <p><b>The <cite>Battle for Wesnoth</cite> code-base</b> is stored in a <b><dfn>version control repository</dfn></b>. Version control allows the entire development team to edit files concurrently. The version control software tracks revisions, stores a record of all edits, and prevents simultaneous editing from causing clashes. All changes are stored in the version control repository. </p><p>When a release is planned, the current set of the files in the repository is <i>"frozen"</i>, given a version number, and shipped out to the world at large. Then, as files continue to be edited by the developers, the repository code advances past that point. The repository (or "<b><dfn>repo</dfn></b>") version is by definition the most up-to-date version of the code. </p><p>The <cite>Wesnoth</cite> repository is a <b>Git</b> repository and is hosted on <b>GitHub</b>: </p> <div style="text-align: center; margin: 1.25em 0 2em;"><b><a rel="nofollow" class="external text" href="https://github.com/wesnoth/wesnoth">&lt;https://github.com/wesnoth/wesnoth&gt;</a></b></div> <div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div> <ul> <li class="toclevel-1 tocsection-1"><a href="#What_is_Git.3F"><span class="tocnumber">1</span> <span class="toctext">What is Git?</span></a> <ul> <li class="toclevel-2"><a href="#Are_you_a_newcomer_to_Git_or_GitHub_who_would_like_to_work_on_Wesnoth.3F"><span class="tocnumber">1.1</span> <span class="toctext">Are you a newcomer to Git or GitHub who would like to work on Wesnoth?</span></a></li> </ul> </li> <li class="toclevel-1 tocsection-2"><a href="#Browse_the_code"><span class="tocnumber">2</span> <span class="toctext">Browse the code</span></a> <ul> <li class="toclevel-2"><a href="#Want_a_GUI_for_Git.3F"><span class="tocnumber">2.1</span> <span class="toctext">Want a GUI for Git?</span></a></li> </ul> </li> <li class="toclevel-1 tocsection-3"><a href="#Download"><span class="tocnumber">3</span> <span class="toctext">Download</span></a> <ul> <li class="toclevel-2"><a href="#Technical_aside:_Git_transport_protocols"><span class="tocnumber">3.1</span> <span class="toctext">Technical aside: Git transport protocols</span></a></li> <li class="toclevel-2 tocsection-4"><a href="#FAQ"><span class="tocnumber">3.2</span> <span class="toctext">FAQ</span></a></li> </ul> </li> <li class="toclevel-1 tocsection-5"><a href="#Push_access"><span class="tocnumber">4</span> <span class="toctext">Push access</span></a> <ul> <li class="toclevel-2 tocsection-6"><a href="#Force-pushing_policy"><span class="tocnumber">4.1</span> <span class="toctext">Force-pushing policy</span></a></li> </ul> </li> <li class="toclevel-1 tocsection-7"><a href="#Update"><span class="tocnumber">5</span> <span class="toctext">Update</span></a></li> <li class="toclevel-1 tocsection-8"><a href="#Reviewing_your_changes"><span class="tocnumber">6</span> <span class="toctext">Reviewing your changes</span></a></li> <li class="toclevel-1 tocsection-9"><a href="#Generating_patches"><span class="tocnumber">7</span> <span class="toctext">Generating patches</span></a></li> <li class="toclevel-1 tocsection-10"><a href="#Push_to_your_own_fork"><span class="tocnumber">8</span> <span class="toctext">Push to your own fork</span></a></li> <li class="toclevel-1 tocsection-11"><a href="#See_Also"><span class="tocnumber">9</span> <span class="toctext">See Also</span></a></li> </ul> </div> <h2><span id="What_is_Git?"></span><span class="mw-headline" id="What_is_Git.3F">What is <cite>Git</cite>?</span></h2> <table style="float: right; max-width: 43.75%; margin: 0 0 1em 1em; padding: .5em; border: 1px solid #AAA; background-color: #FAF3E9;"> <tbody><tr> <th><h6 style="font-size: 1.03125rem; padding: 0; color: #212121;"><span id="Are_you_a_newcomer_to_Git_or_GitHub_who_would_like_to_work_on_Wesnoth?"></span><span class="mw-headline" id="Are_you_a_newcomer_to_Git_or_GitHub_who_would_like_to_work_on_Wesnoth.3F">Are you a newcomer to Git or GitHub who would like to work on <cite>Wesnoth</cite>?</span></h6> </th></tr> <tr> <td>If so, you may find iceiceice's <cite><a href="/Git_for_Wesnoth_Crash_Course" title="Git for Wesnoth Crash Course">Git for Wesnoth Crash Course</a></cite> to be a useful read -- while <cite>WesnothRepository</cite> is also beginner-focused, it's not as extensive as iceiceice's <cite>Crash Course</cite>). </td></tr></tbody></table> <p><dfn>Git</dfn> is the most widely used open-source version-control system. You can learn more about it at its website: </p> <div style="text-align: center; margin: 1.25em 0 2em;"><b><a rel="nofollow" class="external text" href="https://git-scm.com">&lt;https://git-scm.com&gt;</a></b></div> <p>Git replaced <b>Subversion (<dfn>SVN</dfn>)</b> as <cite>Wesnoth</cite>'s version-control system in March 2013. Subversion had, itself, previously replaced an older program, <b>Concurrent Versioning System (<dfn>CVS</dfn>)</b>, in 2005. These earlier systems have left a few traces in the version history which you might encounter; some older documentation and a few files refer to them. </p> <h2><span class="mw-headline" id="Browse_the_code">Browse the code</span></h2> <table style="float: right; max-width: 43.75%; margin: 0 0 1em 1em; padding: .5em; border: 1px solid #AAA; background-color: #FAF3E9;"> <tbody><tr> <th><h6 style="font-size: 1.03125rem; padding: 0; color: #212121;"><span id="Want_a_GUI_for_Git?"></span><span class="mw-headline" id="Want_a_GUI_for_Git.3F">Want a <abbr title="Graphical User Interface">GUI</abbr> for Git?</span></h6> </th></tr> <tr> <td><a rel="nofollow" class="external text" href="https://www.syntevo.com/smartgit/"><cite>SmartGit</cite></a> is cross-platform and supposedly powerful, and the <abbr title="Integrated Development Environments">IDEs</abbr> <a rel="nofollow" class="external text" href="https://www.qt.io/download-open-source/"><cite>Qt Creator</cite></a> and <cite>Microsoft Visual Studio</cite> provide Git GUIs. <em><strong>However</strong></em>, the official Git command-line program is <em>by far</em> the easiest Git program to get help with -- you may well have trouble finding people who can help you with a Git GUI. </td></tr></tbody></table> <p>You can use a Web browser to view the source code at the following Web address: </p> <div style="text-align: center; margin: 1.25em 0 2em;"><b><a rel="nofollow" class="external text" href="https://github.com/wesnoth/wesnoth">&lt;https://github.com/wesnoth/wesnoth&gt;</a></b></div> <p>There are currently two main streams of development ("<dfn>branches</dfn>"): the <b>master</b> branch (1.19.x), and the <b>stable</b> branch (1.18.x). (1.16.x is now <b>oldstable</b>.) Most other branches are only used for a short time to do some testing without disturbing the main development. </p> <h2><span class="mw-headline" id="Download">Download</span></h2> <p>To <i><b>clone</b></i> a copy of the repository into a directory named "<i>wesnoth</i>", run this command: </p> <pre><b>&gt;</b> git clone "https://github.com/wesnoth/wesnoth.git" wesnoth </pre> <table style="float: right; max-width: 43.75%; margin: 0 0 1em 1em; padding: .5em; border: 1px solid #AAA; background-color: #FAF3E9; font-size:.75em;line-height:1.6"> <tbody><tr> <th><h6 style="font-size: 1.03125rem; padding: 0; color: #212121;"><span class="mw-headline" id="Technical_aside:_Git_transport_protocols">Technical aside: Git transport protocols</span></h6> </th></tr> <tr> <td>There are other <b><dfn>transport protocols</dfn></b>, in addition to <b>Hypertext Transfer Protocol Secure (<dfn>HTTPS</dfn>)</b>, over which one can clone a Git repository from GitHub, including: <ul><li><b>Secure Shell (<dfn>SSH</dfn>)</b> ("<code>ssh://git@github.com/wesnoth/wesnoth.git</code>", or "<code>git@github.com:wesnoth/wesnoth.git</code>"), which provides a bit more security, and can be more convenient for developers, but needs to be set up first (see the "Push access" section, below).</li> <li>Git's <b>native transport</b> protocol ("<code>git://github.com/wesnoth/wesnoth.git</code>"), which <em>may</em> be somewhat faster than HTTPS (though GitHub uses a faster <b>"smart" HTTPS</b> transport), but is <em><strong>insecure</strong></em> and should be used (if one <em>must</em> use it) with caution (<em>check the commit hashes!</em>).</li></ul> <p><b>A more detailed explanation</b> is available <a rel="nofollow" class="external text" href="https://gist.github.com/grawity/4392747">here</a>. </p> </td></tr></tbody></table> <p><small style="font-size: 95%">(<b>Note:</b> the "<b>&gt;</b>" sigil represents a command prompt; <b>don't type it in</b>.)</small> </p> <h3><span class="mw-headline" id="FAQ">FAQ</span></h3> <p><b>Q: The repository is about three gigabytes large, and my Internet connection is not stable enough to reliably download it. What should I do?</b> </p><p><b>A:</b> <a rel="nofollow" class="external free" href="https://stackoverflow.com/questions/9268378/how-do-i-clone-a-large-git-repository-on-an-unreliable-connection">https://stackoverflow.com/questions/9268378/how-do-i-clone-a-large-git-repository-on-an-unreliable-connection</a> </p> <ol><li>Use a download manager to download the directory "<a rel="nofollow" class="external free" href="https://github.com/wesnoth/wesnoth.git">https://github.com/wesnoth/wesnoth.git</a>", in one or more sessions.</li> <li>Put this "<i>wesnoth.git</i>" directory, which is the internals of the <cite>Wesnoth</cite> repository, in a new, empty directory.</li> <li>Rename the "<i>wesnoth.git</i>" directory to "<i>.git</i>".</li> <li>Finally, run these commands in the directory that contains the "<i>.git</i>" directory:</li></ol> <pre><b>&gt;</b> git remote add remote "https://github.com/wesnoth/wesnoth.git" <b>&gt;</b> git reset --hard HEAD </pre> <p>The first command links your local repository to the upstream repository; the second <dfn>checks out</dfn> a <dfn>working tree</dfn> (i.e., copies the files out of the "<i>.git</i>" directory into a form that you can use). </p><p><b>Alternative:</b> This will make a shallow clone and allow you to fetch additional history as desired. </p> <ol><li>Start by using a clone command</li> <li>Run a git fetch command with an increased depth, such as "git fetch --depth=2000"</li> <li>Continue to run additional fetch commands, each time increasing the depth, based on what your connection can handle. As of this writing, the max depth is around 60-70K.</li> <li>When an increase in depth no longer brings additional data, verify you have a complete repository by using "git fetch --unshallow"</li> <li>To fix the single branch checkout aspect, use git config and fetch commands.</li></ol> <p>A sample sequence is shown below. You may want to use smaller depth increases (i.e.,2-5K) based on your connection speed and reliability. </p> <pre><b>&gt;</b> git clone --depth 1 "https://github.com/wesnoth/wesnoth.git" wesnoth <b>&gt;</b> git fetch --depth=10000 <b>&gt;</b> git fetch --depth=20000 <b>&gt;</b> git fetch --depth=30000 <b>&gt;</b> git fetch --depth=40000 <b>&gt;</b> git fetch --depth=50000 <b>&gt;</b> git fetch --depth=60000 <b>&gt;</b> git fetch --depth=70000 <b>&gt;</b> git fetch --unshallow <b>&gt;</b> git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" <b>&gt;</b> git fetch origin </pre> <p><b>Q: I don't want any alternate branches or repository history. How could I avoid downloading that?</b> </p><p><b>A:</b> This simply requires a more elaborate command. For example, to only download the last revision of the 1.18 branch, and store it in a directory named "<i>wesnoth-1.18-single-branch-test</i>": </p> <pre><b>&gt;</b> git clone --branch 1.18 --single-branch --depth 1 "https://github.com/wesnoth/wesnoth.git" wesnoth-1.18-single-branch-test </pre> <p>Example results: </p> <pre><b>&gt;</b> git clone --branch 1.18 --single-branch --depth 1 "https://github.com/wesnoth/wesnoth.git" wesnoth-1.18-single-branch-test Cloning into 'wesnoth-1.18-single-branch-test'... remote: Counting objects: 20751, done. remote: Compressing objects: 100% (20087/20087), done. remote: Total 20751 (delta 968), reused 11881 (delta 416), pack-reused 0 Receiving objects: 100% (20751/20751), 444.98 MiB | 636.00 KiB/s, done. Resolving deltas: 100% (968/968), done. Checking out files: 100% (20369/20369), done. <b>&gt;</b> du -sh wesnoth-1.18-single-branch-test <i># "du" means "disk usage".</i> 1.3G wesnoth-1.18-single-branch-test </pre> <p>However, for development and testing, it is often better to have some of the repository history, so that you can quickly check out older versions of the repository to pin down a bug. </p> <h2><span class="mw-headline" id="Push_access">Push access</span></h2> <p>For <b><dfn>push access</dfn></b> (the capability to <i>push</i> changes from your local repository) to our <i>upstream</i> repository on GitHub, you must have an account on GitHub, which must be registered as part of the <a rel="nofollow" class="external text" href="https://github.com/wesnoth"><i>Battle for Wesnoth</i></a> organization. </p><p>It may be convenient to use Git's <b>Secure Shell (SSH) transport protocol</b>, so that you needn't either enter your username and password each time you push commits, or insecurely store those credentials in an unencrypted configuration file. To use the SSH transport, you will need to generate an SSH <i><b>key pair</b></i> with a command like (on Unix descendent operating systems, including Linux distributions and Apple macOS, at least) this: </p> <pre><b>&gt;</b> ssh-keygen -t ed25519 -f "<var>&lt;file&gt;</var>" -C "<var>&lt;your name&gt;</var>'s SSH key for GitHub" </pre> <p>On a typical Linux distribution or on Apple macOS, <var>&lt;file&gt;</var> would be, e.g., "<i>~/.ssh/id-key-for-github</i>". </p><p>Once you have generated an SSH key pair, put the following into your SSH configuration file (on Unix descendent systems, this is generally "<i>~/.ssh/config</i>"): </p> <pre>Host github.com IdentityFile <var>&lt;file&gt;</var> </pre> <p>Then register the key with GitHub, by going to <a rel="nofollow" class="external text" href="https://github.com/settings/ssh">&lt;https://github.com/settings/ssh&gt;</a>, selecting "Add SSH key", and pasting the contents of the <i><b>public key</b></i> file (<var>&lt;file&gt;</var>, but with a "<i>.pub</i>" extension) into the "Key" field. </p><p>Then, if you have not yet cloned the repository, clone it via SSH: </p> <pre><b>&gt;</b> git clone "ssh://git@github.com/wesnoth/wesnoth.git" wesnoth </pre> <p>If you have already cloned the repository, you can set it to use SSH transfer: </p> <pre><b>&gt;</b> git remote set-url origin "ssh://git@github.com/wesnoth/wesnoth.git" </pre> <p>You can also leave your local repo using the read-only URL, and add a <b>pushurl</b>. Manually editing the .git/config also allows it to be commented-out to avoid accidentally pushing to it instead of a fork: </p> <pre> [remote "origin"] url = https://github.com/wesnoth/wesnoth # pushurl = git@github.com:wesnoth/wesnoth.git fetch = +refs/heads/*:refs/remotes/origin/* </pre> <h3><span class="mw-headline" id="Force-pushing_policy">Force-pushing policy</span></h3> <p>A <b><dfn>forced push</dfn></b> rewrites a branch tip to point to a new commit without checking first whether the new commit is a descendant of the current tip. This effectively allows you to rewrite the commit history of a branch, which may be useful when working with pull requests from your own <a href="#Push_to_your_own_fork">personal fork</a>. </p> <pre><b>&gt;</b> git push --force fork <var>&lt;branch name&gt;</var> </pre> <p>However, for a public repository depended upon by more than a handful people like any of the <cite>Wesnoth</cite> repositories at <a rel="nofollow" class="external text" href="https://github.com/wesnoth">&lt;https://github.com/wesnoth&gt;</a>, force-pushing becomes a serious inconvenience that may have negative consequences in some cases, if history is lost in the process. For this reason, <strong>force-pushing to the upstream <cite>Wesnoth</cite> repositories is <em>NOT allowed</em> unless specifically authorized by the repository administrators in order to resolve an urgent issue</strong>. </p> <h2><span class="mw-headline" id="Update">Update</span></h2> <p>Do this from inside the <i>wesnoth</i> directory: </p> <pre><b>&gt;</b> git pull </pre> <h2><span class="mw-headline" id="Reviewing_your_changes">Reviewing your changes</span></h2> <p>Before committing, it's always wise to run: </p> <pre><b>&gt;</b> git diff </pre> <p>and look at the output. Some kinds of mistakes that are hard to see embedded in all the code you have modified are more easily spotted in the isolated diff lines. </p> <h2><span class="mw-headline" id="Generating_patches">Generating patches</span></h2> <p>Under Git on a Unix-like operating system, you'll typically do </p> <pre><b>&gt;</b> git format-patch HEAD~1..HEAD </pre> <p>or something similar; "HEAD~1" may be replaced by a hash or symbolic reference to any earlier revision. This will produce one or more patch files, numbered and ending with the extension ".patch". See <a href="/PatchSubmissionGuidelines" title="PatchSubmissionGuidelines">PatchSubmissionGuidelines</a> for more on how to get these merged into the public repository. </p> <h2><span class="mw-headline" id="Push_to_your_own_fork">Push to your own fork</span></h2> <p>If you have an account on GitHub, you can fork the repository and add your fork as a remote of your clone. </p> <pre><b>&gt;</b> git remote add fork git@github.com:YOUR_USERNAME/wesnoth.git </pre> <p>You can then push your branches to your fork: </p> <pre><b>&gt;</b> git push fork branch_name </pre> <p>Or, if you want to push one branch in your local repository to another in the remote repository: </p> <pre><b>&gt;</b> git push fork local_branch_name:remote_branch_name </pre> <p>You can then create pull requests from your branches in GitHub’s Web interface. </p> <h2><span class="mw-headline" id="See_Also">See Also</span></h2> <ul><li><a href="/Git_for_Wesnoth_Crash_Course" title="Git for Wesnoth Crash Course">Git for Wesnoth Crash Course</a></li></ul> <!-- NewPP limit report Cached time: 20250222011257 Cache expiry: 86400 Dynamic content: false CPU time usage: 0.021 seconds Real time usage: 0.027 seconds Preprocessor visited node count: 261/1000000 Preprocessor generated node count: 675/1000000 Post‐expand include size: 4280/2097152 bytes Template argument size: 2309/2097152 bytes Highest expansion depth: 4/40 Expensive parser function count: 0/100 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 538/5000000 bytes --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 10.035 1 -total 49.57% 4.974 3 Template:SideBox 32.11% 3.222 3 Template:FeaturedURL 17.78% 1.784 2 Template:Abbr 13.57% 1.362 1 Template:Compiling_Wesnoth --> </div> <!-- Saved in parser cache with key wiki-mw_:pcache:idhash:1570-0!canonical and timestamp 20250222011257 and revision id 73257 --> </div> <!-- end wikipage --> <div class="printfooter"> Retrieved from "<a dir="ltr" href="https://wiki.wesnoth.org/index.php?title=WesnothRepository&amp;oldid=73257">https://wiki.wesnoth.org/index.php?title=WesnothRepository&amp;oldid=73257</a>" </div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/Special:Categories" title="Special:Categories">Category</a>: <ul><li><a href="/Category:Development" title="Category:Development">Development</a></li></ul></div></div><div id="lastmod"> This page was last edited on 19 July 2024, at 08:52.</div> <div class="visualClear"></div> </div> <!-- bodyContent --> </div> <!-- end content --> </div> <!-- end main --> <div id="footer-sep"></div> <div id="footer"><div id="footer-content"><div> <a href="https://wiki.wesnoth.org/StartingPoints">Site Map</a> &#8226; <a href="https://status.wesnoth.org/">Site Status</a><br /> Copyright &copy; 2003&ndash;2024 by <a rel="author" href="https://wiki.wesnoth.org/Project">The Battle for Wesnoth Project</a> — Powered by <a href="https://www.mediawiki.org/">MediaWiki</a><br /> Site design Copyright &copy; 2017&ndash;2024 by Iris Morelle </div></div></div> <script>(window.RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgPageParseReport":{"limitreport":{"cputime":"0.021","walltime":"0.027","ppvisitednodes":{"value":261,"limit":1000000},"ppgeneratednodes":{"value":675,"limit":1000000},"postexpandincludesize":{"value":4280,"limit":2097152},"templateargumentsize":{"value":2309,"limit":2097152},"expansiondepth":{"value":4,"limit":40},"expensivefunctioncount":{"value":0,"limit":100},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":538,"limit":5000000},"timingprofile":["100.00% 10.035 1 -total"," 49.57% 4.974 3 Template:SideBox"," 32.11% 3.222 3 Template:FeaturedURL"," 17.78% 1.784 2 Template:Abbr"," 13.57% 1.362 1 Template:Compiling_Wesnoth"]},"cachereport":{"timestamp":"20250222011257","ttl":86400,"transientcontent":false}}});});</script><script>(window.RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgBackendResponseTime":21});});</script></body></html>

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