This post explains how to set up a GitHub project.
What is GitHub?
GitHub is a repository service based on code control version system (CVS) Git.
GitHub has many things in common with Git, so it is important to be familiar with this CVS. You can read an introduction to Git on this post.
The service is provided by the company of the same name, that it is a subsidiary of Microsoft since 2018.
GitHub is a closed source implementation of Git.
First Steps on GitHub
If it is the first time you use GitHub, you may find useful the official introduction that can be followed on this external link.
For more advanced topics, you can find the official Getting Started section on this external link.
GitHub Licenses
As of 2023, GitHub has these licenses:
- GitHub Free
- GitHub Pro
- GitHub Team
- GitHub Enterprise
GitHub Free is free of charge, as the name implies. Open source projects would fall under this category. This license has some limitations compared to the others.
Core functions of GitHub are free since 2020.
GitHub Pro, GitHub Team and GitHub Enterprise are paid licenses.
You can find GitHub’s product catalog on this external link, and the FAQs on this external link.
Remote access configuration
Getting an Access Token
Go to Settings > Developer Settings > Personal Access Tokens.
GitHub used “main” for the main branch, while git uses “master” by default.
Connecting through SSH
Open a terminal, go to the project folder and type:
git remote set-url origin git@github.com:username/project-name.git
GitHub Project File Structure
Integrating GitHub on IDEs
You can integrate your Integrated Development Environment (IDE) with GitHub projects.
Integrating GitHub on Visual Studio Code
You can follow the instructions to integrate GitHub on Visual Studio Code on this external link.
It explains how to install the GitHub Pull Requests and Issues extension, and configure it.
Open the Command Palette (Ctrl + Shift + P) and type “Git: Clone”. Select the local destination folder.
Integrating GitHub on PyCharm
You can read this post about how to integrate GitHub on PyCharm.
Activating GitHub Pages
Activating GitHub Pages for Quarto
From the local folder:
git branch -M main
git remote add origin https://github.com/username/project-name-v3.git
git push -u origin main
Activate GitHub Pages on GitHub: go to GitHub project main page, go to “Setting” tab, find “Actions” on the list on the left and then click on “General”. Go to “Workflows permissions”. Check the option “Read and write permissions” and clik Save.
Open a terminal and go to your local project folder.
mkdir -p .github/workflows
Create a file with nano .github/workflows/publish.yml and paste this test:
on:
push:
branches: main
name: Quarto Publish
jobs:
build-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Render and Publish
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Push the file to GitHub:
git add .github/workflows/publish.yml
git commit -m "Configurar GitHub Actions para publicar Quarto"
git push
Activate Quarto GitHub Pages:
quarto publish gh-pages
Click “yes”.
[…] Introduction to GitHub […]