Welcome to GitHub! In this guide, we'll walk you through the basics of using GitHub to manage and collaborate on code.
GitHub is a platform for storing and sharing code. It helps you keep track of changes made to your code and collaborate with others.
First, make sure you have a GitHub account and Git installed on your computer. You can download Git here.
The terminal is a text-based way to interact with your computer. Here are some basic commands:
pwd
: Shows your current directory.cd
: Changes directory.ls
: Lists files and directories.
- Open your terminal (Command+Space on Mac, search for "powershell" on Windows).
- Navigate to the directory where you want to store your code using
cd
commands. - Clone the repository by copying the HTTPS link from GitHub and running
git clone [repository link]
.
- Open the cloned repository in a text editor.
- Edit the files as needed.
- Use
git add .
to stage your changes. - Commit your changes with a descriptive message using
git commit -m "Your message here"
. - Push your changes to GitHub using
git push origin main
.
GitHub allows you to work on different versions of your code using branches. You can switch branches using the dropdown menu on the GitHub interface.
That's it! You've now learned the basics of using GitHub for version control and collaboration.