CINXE.COM

devel:git [DokuWiki]

<!DOCTYPE html> <html lang="en" dir="ltr" class="no-js"> <head> <meta charset="utf-8" /> <title>devel:git [DokuWiki]</title> <meta name="generator" content="DokuWiki"/> <meta name="theme-color" content="#008800"/> <meta name="robots" content="index,follow"/> <meta name="keywords" content="devel,git"/> <link rel="search" type="application/opensearchdescription+xml" href="/lib/exe/opensearch.php" title="DokuWiki"/> <link rel="start" href="/"/> <link rel="contents" href="/devel:git?do=index" title="Sitemap"/> <link rel="manifest" href="/lib/exe/manifest.php"/> <link rel="alternate" type="application/rss+xml" title="Recent Changes" href="/feed.php"/> <link rel="alternate" type="application/rss+xml" title="Current namespace" href="/feed.php?mode=list&amp;ns=devel"/> <link rel="edit" title="Edit this page" href="/devel:git?do=edit"/> <link rel="alternate" type="text/html" title="Plain HTML" href="/_export/xhtml/devel:git"/> <link rel="alternate" type="text/plain" title="Wiki Markup" href="/_export/raw/devel:git"/> <link rel="canonical" href="https://www.dokuwiki.org/devel:git"/> <link rel="stylesheet" href="/lib/exe/css.php?t=dokuwiki&amp;tseed=f1005bad3d81fc9c803c7f93d32a390e"/> <link rel="alternate" hreflang="fr" href="https://www.dokuwiki.org/fr:devel:git"/> <link rel="alternate" hreflang="ja" href="https://www.dokuwiki.org/ja:devel:git"/> <link rel="alternate" hreflang="th" href="https://www.dokuwiki.org/th:devel:git"/> <link rel="alternate" hreflang="x-default" href="https://www.dokuwiki.org/devel:git"/> <script >var NS='devel';var JSINFO = {"plugins":{"edittable":{"default columnwidth":""}},"id":"devel:git","namespace":"devel","ACT":"show","useHeadingNavigation":0,"useHeadingContent":0};(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement);</script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.4/jquery.min.js" defer="defer"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min.js" defer="defer"></script> <script src="/lib/exe/js.php?t=dokuwiki&amp;tseed=f1005bad3d81fc9c803c7f93d32a390e&amp;lang=en" defer="defer"></script> <meta name="viewport" content="width=device-width,initial-scale=1" /> <link rel="shortcut icon" href="/lib/tpl/dokuwiki/images/favicon.ico" /> <link rel="apple-touch-icon" href="/lib/tpl/dokuwiki/images/apple-touch-icon.png" /> <meta name="verify-v1" content="OVxl3gsCv2MhZqh1cBQyl0JytWXSwXMjyvwc+4w3WtA=" /> <meta name="google-site-verification" content="YhTVK69hW94ZXUtc2zSLPxTkZKbZIn0zK67mz5WQB-E" /> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-83791-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-83791-1', { 'anonymize_ip': true }); </script> </head> <body> <div id="dokuwiki__site"><div id="dokuwiki__top" class="site dokuwiki mode_show tpl_dokuwiki showSidebar hasSidebar"> <!-- ********** HEADER ********** --> <header id="dokuwiki__header"><div class="pad group"> <div class="headings group"> <ul class="a11y skip"> <li><a href="#dokuwiki__content">skip to content</a></li> </ul> <h1 class="logo"><a href="/start" accesskey="h" title="Home [h]"><img src="/lib/tpl/dokuwiki/images/logo.png" width="64" height="64" alt="" /><span>DokuWiki</span></a></h1> <p class="claim">It's better when it's simple</p> </div> <div class="tools group"> <!-- USER TOOLS --> <div id="dokuwiki__usertools"> <h3 class="a11y">User Tools</h3> <ul> <li class="action login"><a href="/devel:git?do=login&amp;sectok=" title="Log In" rel="nofollow"><span>Log In</span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M10 17.25V14H3v-4h7V6.75L15.25 12 10 17.25M8 2h9a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2v-4h2v4h9V4H8v4H6V4a2 2 0 0 1 2-2z"/></svg></a></li> </ul> </div> <!-- SITE TOOLS --> <div id="dokuwiki__sitetools"> <h3 class="a11y">Site Tools</h3> <form action="/start" method="get" role="search" class="search doku_form" id="dw__search" accept-charset="utf-8"><input type="hidden" name="do" value="search" /><input type="hidden" name="id" value="devel:git" /><div class="no"><input name="q" type="text" class="edit" title="[F]" accesskey="f" placeholder="Search" autocomplete="on" id="qsearch__in" value="" /><button value="1" type="submit" title="Search">Search</button><div id="qsearch__out" class="ajax_qsearch JSpopup"></div></div></form> <div class="mobileTools"> <form action="/doku.php" method="get" accept-charset="utf-8"><div class="no"><input type="hidden" name="id" value="devel:git" /><select name="do" class="edit quickselect" title="Tools"><option value="">Tools</option><optgroup label="Page Tools"><option value="edit">Edit this page</option><option value="revisions">Old revisions</option><option value="backlink">Backlinks</option></optgroup><optgroup label="Site Tools"><option value="recent">Recent Changes</option><option value="media">Media Manager</option><option value="index">Sitemap</option></optgroup><optgroup label="User Tools"><option value="login">Log In</option></optgroup></select><button type="submit">&gt;</button></div></form> </div> <ul> <li class="action recent"><a href="/devel:git?do=recent" title="Recent Changes [r]" rel="nofollow" accesskey="r">Recent Changes</a></li><li class="action media"><a href="/devel:git?do=media&amp;ns=devel" title="Media Manager" rel="nofollow">Media Manager</a></li><li class="action index"><a href="/devel:git?do=index" title="Sitemap [x]" rel="nofollow" accesskey="x">Sitemap</a></li> </ul> </div> </div> <!-- BREADCRUMBS --> <div class="breadcrumbs"> <div class="trace"><span class="bchead">Trace:</span> <span class="bcsep">•</span> <span class="curid"><bdi><a href="/devel:git" class="breadcrumbs" title="devel:git">git</a></bdi></span></div> </div> <hr class="a11y" /> </div></header><!-- /header --> <div class="wrapper group"> <!-- ********** ASIDE ********** --> <nav id="dokuwiki__aside" aria-label="Sidebar"><div class="pad aside include group"> <h3 class="toggle">Sidebar</h3> <div class="content"><div class="group"> <div class="plugin_translation is-dropdown"><span class="title">Translations of this page<sup><a href="/localization" class="wikilink1" title="localization" data-wiki-id="localization">?</a></sup>: </span><ul><li class="span"><span class="wikilink1" title="English">English (en)</span></li><li class="a"><a class="wikilink2" title="|العربية" href="/ar:devel:git">|العربية (ar)</a></li><li class="a"><a class="wikilink2" title="Català" href="/ca:devel:git">Català (ca)</a></li><li class="a"><a class="wikilink2" title="Česky" href="/cs:devel:git">Česky (cs)</a></li><li class="a"><a class="wikilink2" title="Dansk" href="/da:devel:git">Dansk (da)</a></li><li class="a"><a class="wikilink2" title="Deutsch" href="/de:devel:git">Deutsch (de)</a></li><li class="a"><a class="wikilink2" title="Ελληνικά" href="/el:devel:git">Ελληνικά (el)</a></li><li class="a"><a class="wikilink2" title="Esperanto" href="/eo:devel:git">Esperanto (eo)</a></li><li class="a"><a class="wikilink2" title="Español" href="/es:devel:git">Español (es)</a></li><li class="a"><a class="wikilink2" title="فارسی" href="/fa:devel:git">فارسی (fa)</a></li><li class="a"><a class="wikilink1" title="Français" href="/fr:devel:git">Français (fr)</a></li><li class="a"><a class="wikilink2" title="עברית" href="/he:devel:git">עברית (he)</a></li><li class="a"><a class="wikilink2" title="Magyar" href="/hu:devel:git">Magyar (hu)</a></li><li class="a"><a class="wikilink2" title="Italiano" href="/it:devel:git">Italiano (it)</a></li><li class="a"><a class="wikilink1" title="日本語" href="/ja:devel:git">日本語 (ja)</a></li><li class="a"><a class="wikilink2" title="한국어" href="/ko:devel:git">한국어 (ko)</a></li><li class="a"><a class="wikilink2" title="Lietuvių Kalba" href="/lt:devel:git">Lietuvių Kalba (lt)</a></li><li class="a"><a class="wikilink2" title="Nederlands" href="/nl:devel:git">Nederlands (nl)</a></li><li class="a"><a class="wikilink2" title="Norsk" href="/no:devel:git">Norsk (no)</a></li><li class="a"><a class="wikilink2" title="Polski" href="/pl:devel:git">Polski (pl)</a></li><li class="a"><a class="wikilink2" title="Português" href="/pt-br:devel:git">Português (pt-br)</a></li><li class="a"><a class="wikilink2" title="Română" href="/ro:devel:git">Română (ro)</a></li><li class="a"><a class="wikilink2" title="Русский" href="/ru:devel:git">Русский (ru)</a></li><li class="a"><a class="wikilink2" title="Српски Језик" href="/sr:devel:git">Српски Језик (sr)</a></li><li class="a"><a class="wikilink2" title="Svenska" href="/sv:devel:git">Svenska (sv)</a></li><li class="a"><a class="wikilink1" title="ไทย" href="/th:devel:git">ไทย (th)</a></li><li class="a"><a class="wikilink2" title="Українська" href="/uk:devel:git">Українська (uk)</a></li><li class="a"><a class="wikilink2" title="中文" href="/zh:devel:git">中文 (zh)</a></li><li class="a"><a class="wikilink2" title="繁體中文" href="/zh-tw:devel:git">繁體中文 (zh-tw)</a></li></ul></div> <p> <strong>Learn about DokuWiki</strong> </p> <ul> <li class="level1"><div class="li"> <a href="/features" class="wikilink1" title="features" data-wiki-id="features">Features</a> &amp; <a href="/blogroll" class="wikilink1" title="blogroll" data-wiki-id="blogroll">reviews</a> </div> </li> <li class="level1"><div class="li"> <a href="/install" class="wikilink1" title="install" data-wiki-id="install">Installation guide</a></div> </li> <li class="level1"><div class="li"> <a href="/manual" class="wikilink1" title="manual" data-wiki-id="manual">User manual</a> &amp; <a href="/wiki:syntax" class="wikilink1" title="wiki:syntax" data-wiki-id="wiki:syntax">syntax</a></div> </li> <li class="level1"><div class="li"> <a href="/changes" class="wikilink1" title="changes" data-wiki-id="changes">Release notes</a></div> </li> <li class="level1"><div class="li"> <a href="/faq" class="wikilink1" title="faq" data-wiki-id="faq">FAQ</a></div> </li> </ul> <p> <strong>Advanced Use</strong> </p> <ul> <li class="level1"><div class="li"> <a href="/extensions" class="wikilink1" title="extensions" data-wiki-id="extensions">Extensions</a></div> </li> <li class="level1"><div class="li"> <a href="/development" class="wikilink1" title="development" data-wiki-id="development">Development manual</a></div> </li> </ul> <p> <strong>Corporate Use</strong> </p> <ul> <li class="level1"><div class="li"> <a href="/faq:support" class="wikilink1" title="faq:support" data-wiki-id="faq:support">Get support</a></div> </li> <li class="level1"><div class="li"> <a href="/donate" class="wikilink1" title="donate" data-wiki-id="donate">Donations</a></div> </li> </ul> <p> <strong>Our Community</strong> </p> <ul> <li class="level1"><div class="li"> <a href="/teams:getting_involved" class="wikilink1" title="teams:getting_involved" data-wiki-id="teams:getting_involved">Get involved</a></div> </li> <li class="level1"><div class="li"> <a href="/dokuinstall" class="wikilink1" title="dokuinstall" data-wiki-id="dokuinstall">Users</a></div> </li> <li class="level1"><div class="li"> <a href="http://forum.dokuwiki.org" class="urlextern" title="http://forum.dokuwiki.org">User forum</a></div> </li> <li class="level1"><div class="li"> <a href="/mailinglist" class="wikilink1" title="mailinglist" data-wiki-id="mailinglist">Development mailinglist</a></div> </li> </ul> <hr /> <p> Follow us on <a href="https://phpc.social/@dokuwiki" class="urlextern" title="https://phpc.social/@dokuwiki">Mastodon</a> and other <a href="/social" class="wikilink1" title="social" data-wiki-id="social">social networks</a>. </p> <p> <a href="/privacy" class="wikilink1" title="privacy" data-wiki-id="privacy">Our Privacy Policy</a> </p> </div></div> </div></nav><!-- /aside --> <!-- ********** CONTENT ********** --> <main id="dokuwiki__content"><div class="pad group"> <div class="pageId"><span>devel:git</span></div> <div class="page group"> <!-- wikipage start --> <!-- TOC START --> <div id="dw__toc" class="dw__toc"> <h3 class="toggle">Table of Contents</h3> <div> <ul class="toc"> <li class="level1"><div class="li"><a href="#dokuwiki_git_repository">DokuWiki Git Repository</a></div> <ul class="toc"> <li class="level2"><div class="li"><a href="#how_to_use_git">How to use Git</a></div></li> <li class="level2"><div class="li"><a href="#git_configuration">Git Configuration</a></div></li> <li class="level2"><div class="li"><a href="#using_git_for_dokuwiki">Using Git for DokuWiki</a></div> <ul class="toc"> <li class="level3"><div class="li"><a href="#tips_and_tricks">Tips and Tricks</a></div></li> </ul> </li> <li class="level2"><div class="li"><a href="#use_branches_and_your_own_fork_for_doing_pull_requests">Use branches and your own fork, for doing pull requests</a></div> <ul class="toc"> <li class="level3"><div class="li"><a href="#maintaining_a_stable_version_with_git">Maintaining a stable version with Git</a></div></li> <li class="level3"><div class="li"><a href="#adding_plugin_template_git_repositories_in_the_tree">Adding plugin/template git repositories in the tree</a></div></li> </ul></li> </ul></li> </ul> </div> </div> <!-- TOC END --> <h1 class="sectionedit1" id="dokuwiki_git_repository">DokuWiki Git Repository</h1> <div class="level1"> <p> The <a href="/dokuwiki" class="wikilink1" title="dokuwiki" data-wiki-id="dokuwiki">DokuWiki</a> sources are managed through the <a href="http://git-scm.com/" class="urlextern" title="http://git-scm.com/">Git</a> version control system. Git is a free and open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency. </p> <p> Git is <strong>NOT</strong> offered as optional version control backend for DokuWiki itself. </p> </div> <div class="secedit editbutton_section editbutton_1"><form class="button btn_secedit" method="post" action="/devel:git"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1707212393" /><input type="hidden" name="summary" value="[DokuWiki Git Repository] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="dokuwiki_git_repository" /><input type="hidden" name="codeblockOffset" value="0" /><input type="hidden" name="range" value="1-380" /><button type="submit" title="DokuWiki Git Repository">Edit</button></div></form></div> <h2 class="sectionedit2" id="how_to_use_git">How to use Git</h2> <div class="level2"> <p> Instead of repeating things that were said elsewhere I just want to give some pointers: </p> <ul> <li class="level1"><div class="li"> <a href="https://git-scm.com/download" class="urlextern" title="https://git-scm.com/download">Download Git</a></div> </li> <li class="level1"><div class="li"> <a href="https://git-scm.com/" class="urlextern" title="https://git-scm.com/">Git Community</a></div> </li> <li class="level1"><div class="li"> <a href="https://schacon.github.io/git/user-manual.html" class="urlextern" title="https://schacon.github.io/git/user-manual.html">Git User Manual</a></div> </li> <li class="level1"><div class="li"> <a href="http://contribute.jquery.org/commits-and-pull-requests/" class="urlextern" title="http://contribute.jquery.org/commits-and-pull-requests/">Working with branches: Commits and Pull Requests</a> (by jQuery Community)</div> </li> </ul> <p> There are also some good books about Git: </p> <ul> <li class="level1"><div class="li"> <a href="https://git-scm.com/book/en" class="urlextern" title="https://git-scm.com/book/en">Scott Chacon - Pro Git</a> (ISBN 978-1-43021-833-3) – You can read it online <strong>for free</strong> (CC licensed). Translations are also available (e.g. <a href="https://git-scm.com/book/de" class="urlextern" title="https://git-scm.com/book/de">German</a>).</div> </li> <li class="level1"><div class="li"> <a href="http://www-cs-students.stanford.edu/~blynn/gitmagic/" class="urlextern" title="http://www-cs-students.stanford.edu/~blynn/gitmagic/">Ben Lynn - Git Magic</a> (ISBN 978-1-45152-334-8) – You can read it online <strong>for free</strong> (<abbr title="GNU General Public License">GPL</abbr> licensed). Translations are also available (e.g. <a href="http://www-cs-students.stanford.edu/~blynn/gitmagic/intl/es/" class="urlextern" title="http://www-cs-students.stanford.edu/~blynn/gitmagic/intl/es/">Spanish</a>).</div> </li> <li class="level1"><div class="li"> <a href="https://pragprog.com/titles/tsgit/pragmatic-version-control-using-git/" class="urlextern" title="https://pragprog.com/titles/tsgit/pragmatic-version-control-using-git/">Travis Swicegood - Pragmatic Version Control Using Git</a> (ISBN 978-1-93435-615-9)</div> </li> <li class="level1"><div class="li"> <a href="https://www.amazon.com/dp/0596520123?tag=splitbrain-20" class="interwiki iw_amazon" title="https://www.amazon.com/dp/0596520123?tag=splitbrain-20">Jon Loeliger - Version Control with Git</a> (ISBN 978-0-59652-012-0)</div> </li> </ul> </div> <div class="secedit editbutton_section editbutton_2"><form class="button btn_secedit" method="post" action="/devel:git"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1707212393" /><input type="hidden" name="summary" value="[How to use Git] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="how_to_use_git" /><input type="hidden" name="codeblockOffset" value="0" /><input type="hidden" name="range" value="381-1582" /><button type="submit" title="How to use Git">Edit</button></div></form></div> <h2 class="sectionedit3" id="git_configuration">Git Configuration</h2> <div class="level2"> <p> Before you start using Git, you should configure it with your name and email address: </p> <pre class="code">git config --global user.name &quot;Your Name Comes Here&quot; git config --global user.email you@yourdomain.example.com</pre> <p> And optionally setup colors and few helpful aliases: </p> <pre class="code">git config --global color.ui auto git config --global alias.st status git config --global alias.ci commit git config --global alias.up pull --rebase</pre> </div> <div class="secedit editbutton_section editbutton_3"><form class="button btn_secedit" method="post" action="/devel:git"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1707212393" /><input type="hidden" name="summary" value="[Git Configuration] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="git_configuration" /><input type="hidden" name="codeblockOffset" value="0" /><input type="hidden" name="range" value="1583-2027" /><button type="submit" title="Git Configuration">Edit</button></div></form></div> <h2 class="sectionedit4" id="using_git_for_dokuwiki">Using Git for DokuWiki</h2> <div class="level2"> <p> To fetch the current development version of DokuWiki use the following command (This creates the directory <strong>dokuwiki</strong> for you): </p> <pre class="code">git clone git://github.com/dokuwiki/dokuwiki.git</pre> <p> To update an existing checkout use this command from within the DokuWiki directory: </p> <pre class="code">git pull</pre> <p> When you create a new source file, use this command to add it to the Git repository: </p> <pre class="code">git add somenewfile</pre> <p> When you changed some already tracked files, you need to tell Git about it: </p> <pre class="code">git add --patch</pre> <p> The <code>--patch</code> will interactively ask you what parts you want to check in (very much like <a href="/devel:darcs" class="wikilink1" title="devel:darcs" data-wiki-id="devel:darcs">darcs</a> behaved) </p> <p> When you&#039;re finished with your changes use: </p> <pre class="code">git commit</pre> <p> This will scan your local Git repository to find the changes that have occurred and will locally “commit” your changes so that they are not overwritten by a <code>pull</code>. Unlike CVS it doesn&#039;t actually send the files anywhere at this point though. It&#039;s more like a “local tag” for your own copy of the code. </p> <p> To get your changes included in the official tree, create a patchfile: </p> <pre class="code">git format-patch origin/master</pre> <p> This creates one (or more) numbered patch files that can be mailed manually to the <a href="/mailinglist" class="wikilink1" title="mailinglist" data-wiki-id="mailinglist">mailinglist</a>. However, this method results in extra manual work for the maintainers of DokuWiki, and makes it difficult to provide feedback on your contribution. So please continue to the section below, and try offering your changes as pull requests. </p> </div> <div class="secedit editbutton_section editbutton_4"><form class="button btn_secedit" method="post" action="/devel:git"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1707212393" /><input type="hidden" name="summary" value="[Using Git for DokuWiki] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="using_git_for_dokuwiki" /><input type="hidden" name="codeblockOffset" value="0" /><input type="hidden" name="range" value="2028-3488" /><button type="submit" title="Using Git for DokuWiki">Edit</button></div></form></div> <h3 class="sectionedit5" id="tips_and_tricks">Tips and Tricks</h3> <div class="level3"> <ul> <li class="level1"><div class="li"> <img src="/lib/images/smileys/exclaim.svg" class="icon smiley" alt=":!:" /> Always pull before starting to work on new patches, to make sure you don&#039;t create conflicts.</div> </li> <li class="level1"><div class="li"> Make sure your editor does not change line endings (from Unix LF to DOS CRLF), this would result in a complete file replace, instead of a small patch because each line was changed.</div> </li> <li class="level1"><div class="li"> Make a patch for a single feature. When you worked on two different features (eg, a language fix and a function update), <code>add</code> and <code>commit</code> two patches, with one for each feature. Using the <code>–patch</code> option for <code>add</code> makes that easy for you by asking what to include in the patch.</div> </li> <li class="level1"><div class="li"> We <strong>really prefer</strong> <a href="/devel:github" class="wikilink1" title="devel:github" data-wiki-id="devel:github">pull requests</a>, above patches sent to the <a href="/mailinglist" class="wikilink1" title="mailinglist" data-wiki-id="mailinglist">mailinglist</a>. See below for more guiding for a pull request. You should explain what patches do and why.</div> </li> <li class="level1"><div class="li"> A web interface to the Git repository is available at <a href="https://github.com/dokuwiki/dokuwiki" class="urlextern" title="https://github.com/dokuwiki/dokuwiki">https://github.com/dokuwiki/dokuwiki</a></div> </li> </ul> </div> <div class="secedit editbutton_section editbutton_5"><form class="button btn_secedit" method="post" action="/devel:git"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1707212393" /><input type="hidden" name="summary" value="[Tips and Tricks] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="tips_and_tricks" /><input type="hidden" name="codeblockOffset" value="0" /><input type="hidden" name="range" value="3489-4380" /><button type="submit" title="Tips and Tricks">Edit</button></div></form></div> <h2 class="sectionedit6" id="use_branches_and_your_own_fork_for_doing_pull_requests">Use branches and your own fork, for doing pull requests</h2> <div class="level2"> <p> (Making <a href="https://github.com/dokuwiki/dokuwiki/pulls" class="urlextern" title="https://github.com/dokuwiki/dokuwiki/pulls">pull requests</a> is the preferred manner of contributing) </p> <p> Above explanation mixes your changes with the incoming changes of DokuWiki in the same &#039;branch&#039;, and you cannot publish them directly to Github because you have (probably) not direct commit access to this repository. Therefore, if your intention is to propose your change a <em>fork</em> of the repository at Github is needed, in which you can make <em>branches</em> for each issue you like to fix. </p> <p> First you make at Github your own fork with the &#039;Fork&#039; button topright on <a href="https://github.com/dokuwiki/dokuwiki" class="urlextern" title="https://github.com/dokuwiki/dokuwiki">https://github.com/dokuwiki/dokuwiki</a> </p> <p> With the clone url, shown with the &#039;Code&#039; button, you can fetch your fork on your machine. This create the folder &#039;dokuwiki&#039;: </p> <pre class="code">git clone git@github.com:YourName/dokuwiki.git</pre> <p> Next you add the original DokuWiki repository as extra remote repository: </p> <pre class="code">git remote add upstream git://github.com/dokuwiki/dokuwiki.git</pre> <p> Verification of this addition can done by showing all remotes (origin=your online fork, upstream=original online DokuWiki repo) </p> <pre class="code">git remote -v</pre> <p> If you start making the modifications you like to propose, it is recommended to make first a separate branch in your fork. If your plan is to fix multiple issues (e.g. fix php warnings and add a new feature), please create a branch for each of them. A branch can be created with: </p> <pre class="code">git checkout -b yourbranchname</pre> <p> In this branch you can make your changes. Storing changes in git, goes in two steps: 1) first add the files such that git knows which files are ready, 2) commit the added files. </p> <pre class="code"># add an entire file to the coming commit git add your/file.php # or decide interactively which changes in a file to add to the coming commit git add --patch</pre> <p> After done with adding, commit these changes with </p> <pre class="code">git commit</pre> <p> Advice: try to commit small understandable pieces of code per commit, if the entire change is larger, do not all changes in one commit. This helps later other people that review your proposal <img src="/lib/images/smileys/smile.svg" class="icon smiley" alt=":-)" />. </p> <p> If you wonder what the status is of your repository during the different steps, you can ask git more info: </p> <pre class="code"># shows current status, and gives eventually some hints how to progress git status # show not commit changes git diff</pre> <p> Switching between branches: </p> <pre class="code">git checkout yourbranchname # back to main branch git checkout master</pre> <p> Sometimes you have changes, which are not yet ready for committing, but you like to switch for example between branches. You can temporary store the not committed changes. </p> <pre class="code"># store temporary all not committed changes git stash # if you like to continue, you can reapply the changes git stash apply</pre> <p> Of course there are regularly changes added to DokuWiki&#039;s repository. You can download the history with </p> <pre class="code">git fetch upstream</pre> <p> And next merge them in your branch </p> <pre class="code"># go to your branch (if you are not already there) git checkout yourbranchname # merge the changes from the &#039;master&#039; branch of the &#039;upstream&#039; repository # in the current branch. git merge upstream/master</pre> <p> Alternatively, you can do the fetching and merging at once with one pull command: </p> <pre class="code">git pull upstream master</pre> <p> If you are ready, and all your changes are committed, you can publish your branch to your fork on Github </p> <pre class="code">git push origin yourbranchname</pre> <p> On Github, you see now a notice which let you initiate a Pull request to DokuWikis repository. DokuWiki&#039;s developers will review your proposal and eventually request some changes. </p> <p> Changes can be made locally again in your branch, and committed as before. If done, you can publish them in the same manner as the first time. It will simply sent the extra commits to your fork, and automatically appear in the pull request as well. </p> <pre class="code">git push origin yourbranchname</pre> <p> <strong>Background</strong>: </p> <ul> <li class="level1"><div class="li"> <a href="https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/committing-changes-to-a-pull-request-branch-created-from-a-fork" class="urlextern" title="https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/committing-changes-to-a-pull-request-branch-created-from-a-fork">committing changes to a pull request branch created from a fork</a></div> </li> <li class="level1"><div class="li"> <a href="https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork" class="urlextern" title="https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork">syncing a fork</a></div> </li> <li class="level1"><div class="li"> <a href="https://docs.github.com/en/get-started/using-git/pushing-commits-to-a-remote-repository" class="urlextern" title="https://docs.github.com/en/get-started/using-git/pushing-commits-to-a-remote-repository">pushing commits to a remote repository</a></div> </li> <li class="level1"><div class="li"> <a href="https://training.github.com/downloads/github-git-cheat-sheet/" class="urlextern" title="https://training.github.com/downloads/github-git-cheat-sheet/">https://training.github.com/downloads/github-git-cheat-sheet/</a></div> </li> </ul> </div> <div class="secedit editbutton_section editbutton_6"><form class="button btn_secedit" method="post" action="/devel:git"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1707212393" /><input type="hidden" name="summary" value="[Use branches and your own fork, for doing pull requests] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="use_branches_and_your_own_fork_for_doing_pull_requests" /><input type="hidden" name="codeblockOffset" value="0" /><input type="hidden" name="range" value="4381-8802" /><button type="submit" title="Use branches and your own fork, for doing pull requests">Edit</button></div></form></div> <h3 class="sectionedit7" id="maintaining_a_stable_version_with_git">Maintaining a stable version with Git</h3> <div class="level3"> <p> Git isn&#039;t only for DokuWiki developers. It can be used to get the latest stable version and to update to the next stable version when it is released. To do so you need to clone the repository but checkout the stable branch: </p> <pre class="code">git clone --branch stable https://github.com/dokuwiki/dokuwiki.git</pre> <p> Now you can pull all needed updates whenever a new release is made: </p> <pre class="code">cd dokuwiki git pull</pre> </div> <div class="secedit editbutton_section editbutton_7"><form class="button btn_secedit" method="post" action="/devel:git"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1707212393" /><input type="hidden" name="summary" value="[Maintaining a stable version with Git] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="maintaining_a_stable_version_with_git" /><input type="hidden" name="codeblockOffset" value="0" /><input type="hidden" name="range" value="8803-9244" /><button type="submit" title="Maintaining a stable version with Git">Edit</button></div></form></div> <h3 class="sectionedit8" id="adding_plugin_template_git_repositories_in_the_tree">Adding plugin/template git repositories in the tree</h3> <div class="level3"> <p> You can checkout your plugin repository (or if contributing to others&#039; plugin, your fork of the plugin) in the tree of the development version. By doing this, it integrates well the <a href="/devel:unittesting" class="wikilink1" title="devel:unittesting" data-wiki-id="devel:unittesting">unit tests</a> and global Dokuwiki project settings. </p> <p> Go to the plugins (or template) folder </p> <pre class="code">cd dokuwiki/lib/plugins # or cd dokuwiki/lib/tpl</pre> <p> Clone the plugin repository, this creates the folder &#039;dokuwiki-plugin-example&#039; </p> <pre class="code">git clone git@github.com:YourName/dokuwiki-plugin-example.git</pre> <p> Rename to the correct base name (if you hesitate, check <code><a href="/devel:plugin_info" class="wikilink1" title="devel:plugin_info" data-wiki-id="devel:plugin_info">plugin.info.txt</a></code> or <code><a href="/devel:template_info" class="wikilink1" title="devel:template_info" data-wiki-id="devel:template_info">template.info.txt</a></code>) </p> <pre class="code">mv dokuwiki-plugin-example example</pre> <p> Eventually, you have to configure your IDE to recognize the repository e.g. in <a href="/devel:intellij_idea#mapping_of_plugin_git_repositories" class="wikilink1" title="devel:intellij_idea" data-wiki-id="devel:intellij_idea">InteliJ IDEA</a>. </p> </div> <div class="secedit editbutton_section editbutton_8"><form class="button btn_secedit" method="post" action="/devel:git"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="1707212393" /><input type="hidden" name="summary" value="[Adding plugin/template git repositories in the tree] " /><input type="hidden" name="target" value="section" /><input type="hidden" name="hid" value="adding_plugin_template_git_repositories_in_the_tree" /><input type="hidden" name="codeblockOffset" value="0" /><input type="hidden" name="range" value="9245-" /><button type="submit" title="Adding plugin/template git repositories in the tree">Edit</button></div></form></div> <!-- wikipage stop --> </div> <div class="docInfo"><bdi>devel/git.txt</bdi> · Last modified: <time datetime="2024-02-06T10:39:53+0100">2024-02-06 10:39</time> by <bdi>Aleksandr</bdi></div> <hr class="a11y" /> </div></main><!-- /content --> <!-- PAGE ACTIONS --> <nav id="dokuwiki__pagetools" aria-labelledby="dokuwiki__pagetools__heading"> <h3 class="a11y" id="dokuwiki__pagetools__heading">Page Tools</h3> <div class="tools"> <ul> <li class="edit"><a href="/devel:git?do=edit" title="Edit this page [e]" rel="nofollow" accesskey="e"><span>Edit this page</span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg></a></li><li class="revs"><a href="/devel:git?do=revisions" title="Old revisions [o]" rel="nofollow" accesskey="o"><span>Old revisions</span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M11 7v5.11l4.71 2.79.79-1.28-4-2.37V7m0-5C8.97 2 5.91 3.92 4.27 6.77L2 4.5V11h6.5L5.75 8.25C6.96 5.73 9.5 4 12.5 4a7.5 7.5 0 0 1 7.5 7.5 7.5 7.5 0 0 1-7.5 7.5c-3.27 0-6.03-2.09-7.06-5h-2.1c1.1 4.03 4.77 7 9.16 7 5.24 0 9.5-4.25 9.5-9.5A9.5 9.5 0 0 0 12.5 2z"/></svg></a></li><li class="backlink"><a href="/devel:git?do=backlink" title="Backlinks" rel="nofollow"><span>Backlinks</span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M10.59 13.41c.41.39.41 1.03 0 1.42-.39.39-1.03.39-1.42 0a5.003 5.003 0 0 1 0-7.07l3.54-3.54a5.003 5.003 0 0 1 7.07 0 5.003 5.003 0 0 1 0 7.07l-1.49 1.49c.01-.82-.12-1.64-.4-2.42l.47-.48a2.982 2.982 0 0 0 0-4.24 2.982 2.982 0 0 0-4.24 0l-3.53 3.53a2.982 2.982 0 0 0 0 4.24m2.82-4.24c.39-.39 1.03-.39 1.42 0a5.003 5.003 0 0 1 0 7.07l-3.54 3.54a5.003 5.003 0 0 1-7.07 0 5.003 5.003 0 0 1 0-7.07l1.49-1.49c-.01.82.12 1.64.4 2.43l-.47.47a2.982 2.982 0 0 0 0 4.24 2.982 2.982 0 0 0 4.24 0l3.53-3.53a2.982 2.982 0 0 0 0-4.24.973.973 0 0 1 0-1.42z"/></svg></a></li><li class="top"><a href="#dokuwiki__top" title="Back to top [t]" rel="nofollow" accesskey="t"><span>Back to top</span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"/></svg></a></li> </ul> </div> </nav> </div><!-- /wrapper --> <!-- ********** FOOTER ********** --> <footer id="dokuwiki__footer"><div class="pad"> <div class="license">Except where otherwise noted, content on this wiki is licensed under the following license: <bdi><a href="https://creativecommons.org/licenses/by-sa/4.0/deed.en" rel="license" class="urlextern">CC Attribution-Share Alike 4.0 International</a></bdi></div> <div class="buttons"> <a href="https://creativecommons.org/licenses/by-sa/4.0/deed.en" rel="license"><img src="/lib/images/license/button/cc-by-sa.png" alt="CC Attribution-Share Alike 4.0 International" /></a> <a href="https://www.dokuwiki.org/donate" title="Donate" ><img src="/lib/tpl/dokuwiki/images/button-donate.gif" width="80" height="15" alt="Donate" /></a> <a href="https://php.net" title="Powered by PHP" ><img src="/lib/tpl/dokuwiki/images/button-php.gif" width="80" height="15" alt="Powered by PHP" /></a> <a href="//validator.w3.org/check/referer" title="Valid HTML5" ><img src="/lib/tpl/dokuwiki/images/button-html5.png" width="80" height="15" alt="Valid HTML5" /></a> <a href="//jigsaw.w3.org/css-validator/check/referer?profile=css3" title="Valid CSS" ><img src="/lib/tpl/dokuwiki/images/button-css.png" width="80" height="15" alt="Valid CSS" /></a> <a href="https://dokuwiki.org/" title="Driven by DokuWiki" ><img src="/lib/tpl/dokuwiki/images/button-dw.png" width="80" height="15" alt="Driven by DokuWiki" /></a> </div> <div style="margin-top: 2em; font-size:90%" class="dokuwiki"><div style="float:right"><a href="http://www.splitbrain.org/personal#imprint" style="float:right; text-decoration: none; color:#333">Imprint</a></div></div><!-- Include for DokuWiki site wide top bar --> <style type="text/css"> @media screen { body { padding-top: 30px; } #global__header { position: absolute; top: 0; left: 0; text-align: left; vertical-align: middle; line-height: 1.5; background-color: #333; box-shadow: 0 0 8px rgba(0,0,0,0.5); width: 100%; margin: 0; padding: 5px 20px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; white-space: nowrap; overflow: hidden; } #global__header h2 { position: absolute; left: -99999em; top: 0; overflow: hidden; display: inline; } #global__header ul, #global__header li { margin: 0; padding: 0; list-style: none; display: inline; line-height: 1.5; } #global__header a { color: #bbb; text-decoration: none; margin-right: 20px; font-size: 14px; font-weight: normal; } #global__header a:hover, #global__header a:active, #global__header a:focus { color: #fff; text-decoration: underline; } #global__header form { float: right; margin: 0 0 0 20px; } #global__header input { background-color: #333; background-image: none; border: 1px solid #bbb; color: #fff; box-shadow: none; border-radius: 2px; margin: 0; line-height: normal; padding: 1px 0 1px 0; height: auto; } #global__header input.button { border: none; color: #bbb; } #global__header input.button:hover, #global__header input.button:active, #global__header input.button:focus { color: #fff; text-decoration: underline; } } /* /@media */ @media only screen and (min-width: 601px) { /* changes specific for www.dokuwiki.org */ #dokuwiki__header { padding-top: 3em; } #dokuwiki__usertools { top: 3em; } /* changes specific for bugs.dokuwiki.org */ div#container div#showtask { top: 40px; } } /* /@media */ @media only screen and (max-width: 600px) { body { padding-top: 0; } #global__header { position: static; white-space: normal; overflow: auto; } #global__header form { float: none; display: block; margin: 0 0 .4em; } } /* /@media */ @media print { #global__header { display: none; } } /* /@media */ </style> <div id="global__header"> <h2>Global DokuWiki Links</h2> <form method="get" action="https://search.dokuwiki.org/" target="_top"> <input type="text" name="q" title="Search all DokuWiki sites at once" class="input" /> <input type="submit" title="Search all DokuWiki sites at once" value="Search" class="button" /> </form> <ul> <li><a href="https://download.dokuwiki.org" title="Download the latest release" target="_top">Download</a></li> <li><a href="https://www.dokuwiki.org" title="Read the DokuWiki documentation" target="_top">Wiki</a></li> <li><a href="https://forum.dokuwiki.org" title="Ask questions in the DokuWiki forum" target="_top">Forum</a></li> <li><a href="https://irc.dokuwiki.org" title="Check IRC chat logs or join the chat" target="_top">IRC</a></li> <li><a href="https://github.com/splitbrain/dokuwiki/issues" title="Report and track bugs" target="_top">Bugs</a></li> <li><a href="https://translate.dokuwiki.org/" title="Help translating the DokuWiki interface" target="_top">Translate</a></li> <li><a href="https://github.com/splitbrain/dokuwiki" title="Access the most recent git commits" target="_top">Git</a></li> <li><a href="https://xref.dokuwiki.org/reference/dokuwiki/" title="Cross-Reference of the DokuWiki source code" target="_top">XRef</a></li> <li><a href="https://codesearch.dokuwiki.org/" title="Search through the sources of DokuWiki, plugins and templates" target="_top">Code Search</a></li> </ul> </div> <!-- end of DokuWiki top bar include --> </div></footer><!-- /footer --> </div></div><!-- /site --> <div class="no"><img src="/lib/exe/taskrunner.php?id=devel%3Agit&amp;1742692698" width="2" height="1" alt="" /></div> <div id="screen__mode" class="no"></div></body> </html>

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