contribute_to_paddle.html 12.1 KB
Newer Older
1 2


Y
Yu Yang 已提交
3 4 5 6 7 8 9 10
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
11
    <title>Contribute to PaddlePaddle &#8212; PaddlePaddle  documentation</title>
Y
Yu Yang 已提交
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
    
    <link rel="stylesheet" href="../_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
29 30
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
Y
Yu Yang 已提交
31 32
    <link rel="top" title="PaddlePaddle  documentation" href="../index.html" />
    <link rel="up" title="Build And Install PaddlePaddle" href="index.html" />
33
    <link rel="next" title="User Interface" href="../ui/index.html" />
34
    <link rel="prev" title="Installing from Sources" href="build_from_source.html" /> 
35 36 37 38 39 40 41 42 43 44
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?b9a314ab40d04d805655aab1deee08ba";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>

Y
Yu Yang 已提交
45 46 47 48 49 50 51 52 53 54 55 56
  </head>
  <body role="document">
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
57
          <a href="../ui/index.html" title="User Interface"
Y
Yu Yang 已提交
58 59
             accesskey="N">next</a> |</li>
        <li class="right" >
60
          <a href="build_from_source.html" title="Installing from Sources"
Y
Yu Yang 已提交
61
             accesskey="P">previous</a> |</li>
62 63
        <li class="nav-item nav-item-0"><a href="../index.html">PaddlePaddle  documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Build And Install PaddlePaddle</a> &#187;</li> 
Y
Yu Yang 已提交
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="contribute-to-paddlepaddle">
<span id="contribute-to-paddlepaddle"></span><h1>Contribute to PaddlePaddle<a class="headerlink" href="#contribute-to-paddlepaddle" title="Permalink to this headline"></a></h1>
<p>We sincerely appreciate your contributions. You can use fork and pull request
workflow to merge your code.</p>
<div class="section" id="code-requirements">
<span id="code-requirements"></span><h2>Code Requirements<a class="headerlink" href="#code-requirements" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li>Your code mush be fully documented by
<a class="reference external" href="http://www.stack.nl/~dimitri/doxygen/">doxygen</a> style.</li>
<li>Make sure the compiler option WITH_STYLE_CHECK is on and the compiler
passes the code style check.</li>
<li>All code must have unit test.</li>
<li>Pass all unit tests.</li>
</ul>
<p>The following tutorial guides you into submitting your contibution.</p>
</div>
<div class="section" id="creating-a-fork">
<span id="creating-a-fork"></span><h2><a class="reference external" href="https://help.github.com/articles/fork-a-repo/">Creating a Fork</a><a class="headerlink" href="#creating-a-fork" title="Permalink to this headline"></a></h2>
<p>Just head over to the GitHub page and click the &#8220;Fork&#8221; button.
It&#8217;s just that simple.</p>
</div>
<div class="section" id="clone">
<span id="clone"></span><h2>Clone<a class="headerlink" href="#clone" title="Permalink to this headline"></a></h2>
<p>Once you&#8217;ve created a fork, you can use your favorite git client to clone your
repo or just head straight to the command line:</p>
<div class="highlight-shell"><div class="highlight"><pre><span></span><span class="c1"># Clone your fork to your local machine</span>
98 99 100 101 102
git clone https://github.com/USERNAME/Paddle.git
</pre></div>
</div>
<p>Then you can start to develop by making a local developement branch</p>
<div class="highlight-shell"><div class="highlight"><pre><span></span>git checkout -b MY_COOL_STUFF_BRANCH origin/master
Y
Yu Yang 已提交
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
</pre></div>
</div>
</div>
<div class="section" id="commit">
<span id="commit"></span><h2>Commit<a class="headerlink" href="#commit" title="Permalink to this headline"></a></h2>
<p>Commit your changes by following command lines:</p>
<div class="highlight-shell"><div class="highlight"><pre><span></span><span class="c1"># show the working tree status</span>
git status
<span class="c1"># add modified files</span>
git add xx
git commit -m <span class="s2">&quot;commit info&quot;</span>
</pre></div>
</div>
<p>The first line of commit infomation is the title. The second and later lines
are the details if any.</p>
</div>
<div class="section" id="keeping-fork-up-to-date">
<span id="keeping-fork-up-to-date"></span><h2>Keeping Fork Up to Date<a class="headerlink" href="#keeping-fork-up-to-date" title="Permalink to this headline"></a></h2>
121
<p>Before pull your request, you should sync your code from the latest PaddlePaddle.
Y
Yu Yang 已提交
122 123 124 125
To do this, you&#8217;ll need to add a remote at first:</p>
<div class="highlight-shell"><div class="highlight"><pre><span></span><span class="c1"># see the current configured remote repository</span>
git remote -v
<span class="c1"># add upstream repository</span>
126
git remote add upstream https://github.com/baidu/Paddle.git
Y
Yu Yang 已提交
127 128 129 130 131
<span class="c1"># verify the new upstream</span>
git remote -v
</pre></div>
</div>
<p>Update your fork with the latest upstream changes:</p>
132
<div class="highlight-shell"><div class="highlight"><pre><span></span>git pull --rebase upstream HEAD
Y
Yu Yang 已提交
133 134 135 136 137 138 139 140 141 142
</pre></div>
</div>
<p>If there are no unique commits locally, git will simply perform a fast-forward.
However, if you have been making changes (in the vast majority of cases you
probably shouldn&#8217;t be), you may have to deal with conflicts.</p>
<p>Now, your local master branch is up-to-date with everything modified upstream.</p>
</div>
<div class="section" id="push-to-github">
<span id="push-to-github"></span><h2>Push to GitHub<a class="headerlink" href="#push-to-github" title="Permalink to this headline"></a></h2>
<div class="highlight-shell"><div class="highlight"><pre><span></span><span class="c1"># push to your repository in Github</span>
143
git push origin HEAD
Y
Yu Yang 已提交
144 145 146 147 148 149 150 151
</pre></div>
</div>
</div>
<div class="section" id="pull-request">
<span id="pull-request"></span><h2>Pull Request<a class="headerlink" href="#pull-request" title="Permalink to this headline"></a></h2>
<p>Go to the page for your fork on GitHub, select your development branch,
and click the <strong>pull request button</strong>.</p>
</div>
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
<div class="section" id="update-your-pull-request-with-the-lastest-version">
<span id="update-your-pull-request-with-the-lastest-version"></span><h2>Update your pull request with the lastest version<a class="headerlink" href="#update-your-pull-request-with-the-lastest-version" title="Permalink to this headline"></a></h2>
<p>During the code review, your pull request may become stale because new commits in
baidu/Paddle. GitHub allows autmotic update if there is no conflict. You can do this
by clicking the &#8220;Update Branch&#8221; button in your pull request page. However, in the case
of conflict, you need to do the update manually. You need to do the following on
your local repository:</p>
<div class="highlight-shell"><div class="highlight"><pre><span></span>git checkout MY_COOL_STUFF_BRANCH
git pull --rebase upstream HEAD
<span class="c1"># You may need to resolve the conflict according to the git prompt.</span>
<span class="c1"># Make and test your code.</span>
git push -f origin HEAD
</pre></div>
</div>
<p>Now your Pull Request is updated with the latest version.</p>
</div>
168 169 170 171
<div class="section" id="revise-your-pull-request">
<span id="revise-your-pull-request"></span><h2>Revise your pull request<a class="headerlink" href="#revise-your-pull-request" title="Permalink to this headline"></a></h2>
<p>When you revise your pull request according to reviewer&#8217;s comments, please use &#8216;git commit&#8217; instead of &#8216;git commit &#8211;amend&#8217; to commit your changes so that the reviewers can see the difference between the new pull requrest and the old pull request.</p>
</div>
Y
Yu Yang 已提交
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Contribute to PaddlePaddle</a><ul>
<li><a class="reference internal" href="#code-requirements">Code Requirements</a></li>
<li><a class="reference internal" href="#creating-a-fork">Creating a Fork</a></li>
<li><a class="reference internal" href="#clone">Clone</a></li>
<li><a class="reference internal" href="#commit">Commit</a></li>
<li><a class="reference internal" href="#keeping-fork-up-to-date">Keeping Fork Up to Date</a></li>
<li><a class="reference internal" href="#push-to-github">Push to GitHub</a></li>
<li><a class="reference internal" href="#pull-request">Pull Request</a></li>
190
<li><a class="reference internal" href="#update-your-pull-request-with-the-lastest-version">Update your pull request with the lastest version</a></li>
191
<li><a class="reference internal" href="#revise-your-pull-request">Revise your pull request</a></li>
Y
Yu Yang 已提交
192 193 194 195 196 197
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="build_from_source.html"
198
                        title="previous chapter">Installing from Sources</a></p>
Y
Yu Yang 已提交
199
  <h4>Next topic</h4>
200 201
  <p class="topless"><a href="../ui/index.html"
                        title="next chapter">User Interface</a></p>
Y
Yu Yang 已提交
202 203 204 205 206 207 208 209 210 211
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/build/contribute_to_paddle.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
212 213
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
Y
Yu Yang 已提交
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
233
          <a href="../ui/index.html" title="User Interface"
Y
Yu Yang 已提交
234 235
             >next</a> |</li>
        <li class="right" >
236
          <a href="build_from_source.html" title="Installing from Sources"
Y
Yu Yang 已提交
237
             >previous</a> |</li>
238 239
        <li class="nav-item nav-item-0"><a href="../index.html">PaddlePaddle  documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="index.html" >Build And Install PaddlePaddle</a> &#187;</li> 
Y
Yu Yang 已提交
240 241 242
      </ul>
    </div>
    <div class="footer" role="contentinfo">
243
        &#169; Copyright 2016, PaddlePaddle developers.
244
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.
Y
Yu Yang 已提交
245 246 247
    </div>
  </body>
</html>