- Sign up for a GitHub account here
- Install cookiecutter with
pip
/conda
/apt-get
instructions here - Choose a cookiecutter template (search on GitHub here)
- The one I showed was https://mgancita.github.io/cookiecutter-pypackage/ which does the automatic GitHub-Pages, testing, linting, and more
- Get the link to the cookiecutter repo that ends in
.git
(should be in the template install instructions) - Run
cookiecutter reponame.git
(e.g.cookiecutter https://github.com/mgancita/cookiecutter-pypackage.git
) - Follow the prompts to set the options for your new template folder (your name, the repo name, etc.)
- Change directory to your new empty template (
cd new-repo-name
)- Run
ls
to check out the file/folders it made - Your code goes in
/new-repo-name/new-repo-name/mycode.py
- Your documentation goes in
/new-repo-name/docs/
- Run
- Make your folder into a git repository with
git init
- Add and commit the template files/folers as your first commit
git add .
git commit -m "Set up repo with cookiecutter"
- Go to GitHub, click
+
"make a new repository", call it the same thing as your cookiecutter folder (e.g.new-repo-name
) - Now follow GitHub's instructions to push your new repository to GitHub. Back in the terminal type:
git add remote <blah>
git push -u origin main
- refresh the page to see your brand new repo on GitHub
- (optional) If you used the template above or another one that "Makes a GitHub Pages site with GitHub Actions" then:
- Go to repository settings
- Scroll down to GitHub Pages
- Publish branch
gh-pages
- Go to username.github.io/new-repo-name to see your documentation site
- You can of course wait to do this step until you write the documentation for your code
- Note that even if your repo is private this site will be live publicly as soon as you publish the branch in GitHub settings
- Since the template set up GitHub actions for you, this will update each time you update the
/docs/
and push to GitHub
Created
March 12, 2021 21:23
-
-
Save cjtu/74a38e1ad066e714218762b910d0910e to your computer and use it in GitHub Desktop.
Make a new repo with CookieCutter
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment