Connect to remote repository on GitHub
Initialize local repository
Now lets initialize a git repository within your local project.
First, move into the directory of the project.
$ cd project-name/
Next, follow poetry installation instructions. Note that the terminal will have to be restarted for the installation to be noticed.
Then, install base dependencies:
$ pip install poetry && poetry install
Lastly, initialize the repo.
$ git init
This will create a git repository within the project. Don't do anything just yet with it.
Create remote repository on GitHub
If it hasn't already been created, we'll have to create a remote repository on GitHub. To do so, follow the steps:
- Go to GitHub's create new repository page.
- Fill in the name and description with the values given at project creation.
- Make your choice of Public or Private.
- Leave all other boxes unchecked (they're all populated by the cookiecutter).
Sync local repository with GitHub
Add remote link
Let's start with syncing the newly created remote repository to the local repostiory so it knows where to push changes to. To do so run:
$ git remote add origin link_to_repo
Make sure to replace link_to_repo with your repo's url. It can be found on your repository's home page under the green "Code" dropdown menu button.
Push local files to remote
Now that the remote repository is setup let's get all the code generated by the cookiecutter there.
First let's add all the project files to the local repository (remember we only initalized an empty repository):
$ git add .
Next, commit those changes:
$ git commit -m "Initialize repo"
Then, we name the current branch (with the files) to main:
$ git branch -M main
Note if main
is not used. You must change the branch reference in certain files within the '.github/workflows' directory for CI checks to work.
Finally, lets push it to GitHub:
$ git push -u origin main
That's it! Now you should see your GitHub repository with all the starter files.
In addition, check out the "Actions" section of the repository to see the CI checks (docs deployment and code quality) being run. Once these are done, you'll see a gh-pages
branch was created with odd files. Don't change them as it's the automatically generated documentation files.
Continue on to see how to configure your GitHub repository to work optimally with the cookiecutter setup!