icon: LiWrench
Title: Intro to Git and GitHub (Version Control)
This guide will walk you through the essential GitHub basics required to upload your Streamlit project to a GitHub
repository, enabling you to deploy your application on the Streamlit Community Cloud.
GitHub is a web-based platform that uses Git, a version control system, to help developers collaborate on projects. It allows you to store your code in repositories, track changes, manage project versions, and collaborate with others seamlessly.
GitHub is a web-based platform that hosts Git repositories. It provides additional features for collaboration and project management, such as:
For deploying Streamlit applications, GitHub serves as the central repository where your project files reside, which Streamlit Community Cloud can access to run your app.
Git is a distributed version control system that allows us to track changes in our codebase over time. It enables us to:
Before you can use GitHub, you need to create an account.
✦ Steps to Create an Account:
Download GitHub Desktop
from here and install the software on your laptop that you are using for this Bootcamp.
git
separately since GitHub comes with its own bundled version of git
.💪🏼 This is a great tutorial from Official YouTube channel of Visual Studio Code. This 7-min video covers all the key steps to use Git within VC Code
, allows you to efficiently manage your code repositories, push your code to the remote repository, and track changes, directly from the code editor.
GitHub Desktop
, we can skip the step for installing git
. The rest of the video is still applicable..gitignore
?The .gitignore
file is a special file used by Git to determine which files and directories to ignore in a project. When you add files to your repository, Git tracks changes to those files. However, some files should not be tracked—for example, temporary files, sensitive information, or dependencies that can be recreated. The .gitignore
file tells Git to exclude these files from version control.
Key Points:
.gitignore
placed in the root directory of your project..gitignore
?Using a .gitignore
file offers several benefits:
.env
or secrets.toml
files)venv
folder).gitignore
?within VS Code
, create a plain text file named .gitignore
placed in the root directory of your project. Add the filenames or directories for the file or folders that you want to exclude from being tracked by git or GitHub into the .gitignore
file.
Below are some common entries in the .gitingore
for a Python project.
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# Virtual environments
venv/
env/
ENV/
.venv/
.env
# Distribution / packaging
build/
dist/
*.egg-info/
# VS Code
.vscode/
# PyCharm
.idea/
# Streamlit
.streamlit/secrets.toml
💡👨🏻💻👩🏻💻 If you want to collaborate in real-time with your team members in VS Code
, this is a great video to get started:
🍽️ Wanting more? Here is a series from GitHub's official YouTube channel designed to help you master the basics of GitHub, whether you're new to coding or looking to enhance your version control skills.