contribute_to_paddle.html 11.1 KB
Newer Older
Y
Yu Yang 已提交
1 2 3 4 5 6 7 8
<!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" />
    
9
    <title>Contribute to PaddlePaddle &#8212; PaddlePaddle  documentation</title>
Y
Yu Yang 已提交
10 11 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>
    <link rel="top" title="PaddlePaddle  documentation" href="../index.html" />
    <link rel="up" title="Build And Install PaddlePaddle" href="index.html" />
Y
Yu Yang 已提交
29
    <link rel="next" title="Docker installation guide" href="docker_install.html" />
Y
Yu Yang 已提交
30 31 32 33 34 35 36 37 38 39 40 41 42
    <link rel="prev" title="Build and Install" href="build_from_source.html" /> 
  </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" >
Y
Yu Yang 已提交
43
          <a href="docker_install.html" title="Docker installation guide"
Y
Yu Yang 已提交
44 45 46 47
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="build_from_source.html" title="Build and Install"
             accesskey="P">previous</a> |</li>
48 49
        <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 已提交
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
      </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>
84 85 86 87 88
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 已提交
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
</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>
107
<p>Before pull your request, you should sync your code from the latest PaddlePaddle.
Y
Yu Yang 已提交
108 109 110 111
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>
112
git remote add upstream https://github.com/baidu/Paddle.git
Y
Yu Yang 已提交
113 114 115 116 117
<span class="c1"># verify the new upstream</span>
git remote -v
</pre></div>
</div>
<p>Update your fork with the latest upstream changes:</p>
118
<div class="highlight-shell"><div class="highlight"><pre><span></span>git pull --rebase upstream HEAD
Y
Yu Yang 已提交
119 120 121 122 123 124 125 126 127 128
</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>
129
git push origin HEAD
Y
Yu Yang 已提交
130 131 132 133 134 135 136 137
</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>
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
<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>
Y
Yu Yang 已提交
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
</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>
172
<li><a class="reference internal" href="#update-your-pull-request-with-the-lastest-version">Update your pull request with the lastest version</a></li>
Y
Yu Yang 已提交
173 174 175 176 177 178 179 180
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="build_from_source.html"
                        title="previous chapter">Build and Install</a></p>
  <h4>Next topic</h4>
Y
Yu Yang 已提交
181 182
  <p class="topless"><a href="docker_install.html"
                        title="next chapter">Docker installation guide</a></p>
Y
Yu Yang 已提交
183 184 185 186 187 188 189 190 191 192
  <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">
193 194
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
Y
Yu Yang 已提交
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
      <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" >
Y
Yu Yang 已提交
214
          <a href="docker_install.html" title="Docker installation guide"
Y
Yu Yang 已提交
215 216 217 218
             >next</a> |</li>
        <li class="right" >
          <a href="build_from_source.html" title="Build and Install"
             >previous</a> |</li>
219 220
        <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 已提交
221 222 223
      </ul>
    </div>
    <div class="footer" role="contentinfo">
224 225
        &#169; Copyright 2016, PaddlePaddle developers.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.6.
Y
Yu Yang 已提交
226 227 228
    </div>
  </body>
</html>