|
| 1 | +.. _publishing-your-code-ref: |
| 2 | + |
| 3 | + |
| 4 | +#################### |
| 5 | +Publishing Your Code |
| 6 | +#################### |
| 7 | + |
| 8 | +.. todo:: Replace this kitten with the photo we want. |
| 9 | + |
| 10 | +.. image:: http://placekitten.com/800/600 |
| 11 | + |
| 12 | +A healthy open source project needs a place to publish its code and project |
| 13 | +management stuff so other developers can collaborate with you. This lets your |
| 14 | +users gain a better understanding of your code, keep up with new developments, |
| 15 | +report bugs, and contribute code. |
| 16 | + |
| 17 | +This development web site should include the source code history itself, a bug |
| 18 | +tracker, a patch submission (aka "Pull Request") queue, and possibly additional |
| 19 | +developer-oriented documentation. |
| 20 | + |
| 21 | +There are several free open source project hosting sites (aka "forges"). These |
| 22 | +include GitHub, SourceForge, Bitbucket, and GitLab. GitHub is currently the best. |
| 23 | +Use GitHub. |
| 24 | + |
| 25 | + |
| 26 | +********************************* |
| 27 | +Creating a Project Repo on GitHub |
| 28 | +********************************* |
| 29 | + |
| 30 | +To publish your Python project on GitHub: |
| 31 | + |
| 32 | +1. Create a GitHub account if you don't already have one. |
| 33 | + |
| 34 | +2. Create a new repo for your project. |
| 35 | + |
| 36 | + 1. Click on the "+" menu next to your avatar in the upper right of the page and choose "New repository". |
| 37 | + |
| 38 | + 2. Name it after your project and give it an SEO-friendly description. |
| 39 | + |
| 40 | + 3. If you don't have an existing project repo, choose the settings to add a |
| 41 | + README, `.gitignore`, and license. Use the Python `.gitignore` option. |
| 42 | + |
| 43 | +3. On the newly created repo page, click "Manage topics" and add the tags "python" and "python3" and/or "python2" as appropriate. |
| 44 | + |
| 45 | +4. Include a link to your new GitHub repo in your project's README file so people who just have the project distribution know where to find it. |
| 46 | + |
| 47 | +If this is a brand new repo, clone it to your local machine and start working: |
| 48 | + |
| 49 | +.. code-block:: console |
| 50 | +
|
| 51 | + $ git clone https://github.com/<username>/<projectname> |
| 52 | +
|
| 53 | +Or, if you already have a project Git repo, add your new GitHub repo as a remote: |
| 54 | + |
| 55 | +.. code-block:: console |
| 56 | +
|
| 57 | + $ cd <projectname> |
| 58 | + $ git remote add origin https://github.com/<username>/<projectname> |
| 59 | + $ git push --tags |
| 60 | +
|
| 61 | +*********************** |
| 62 | +When Your Project Grows |
| 63 | +*********************** |
| 64 | + |
| 65 | +For more information about managing an open source software project, see the book |
| 66 | +`Producing Open Source Software <https://producingoss.com/>`_. |
0 commit comments