Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 1.5 KB

git-intro.md

File metadata and controls

33 lines (25 loc) · 1.5 KB

Getting Started with GitHub

BSA REU 2024

Welcome to GitHub! In this guide, we'll walk you through the basics of using GitHub to manage and collaborate on code.

What is GitHub?

GitHub is a platform for storing and sharing code. It helps you keep track of changes made to your code and collaborate with others.

Setup

First, make sure you have a GitHub account and Git installed on your computer. You can download Git here.

Terminal Basics

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.

Cloning a Repository

  1. Open your terminal (Command+Space on Mac, search for "powershell" on Windows).
  2. Navigate to the directory where you want to store your code using cd commands.
  3. Clone the repository by copying the HTTPS link from GitHub and running git clone [repository link].

Making Changes

  1. Open the cloned repository in a text editor.
  2. Edit the files as needed.
  3. Use git add . to stage your changes.
  4. Commit your changes with a descriptive message using git commit -m "Your message here".
  5. Push your changes to GitHub using git push origin main.

Branches

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.