Getting Started with GitHub
Learning Outcomes
After reading this guide, you will understand what GitHub is and why it's valuable for web development. You will know the difference between Git and GitHub, understand basic GitHub terminology, and be prepared to create your own GitHub account. These fundamentals provide the foundation for using GitHub effectively to store code, collaborate, and publish websites.
Prerequisites
No prior experience with version control or GitHub is required. You only need an email address to create a GitHub account and basic familiarity with using websites and web browsers.
What is GitHub?
GitHub is a web-based platform that provides hosting and collaboration tools for software development projects. At its core, GitHub stores code files in online repositories, which are organized collections of project files.
GitHub builds on Git, which is a version control system that tracks changes to files over time, allowing you to:
- See the history of your project
- Revert to previous versions if needed
- Track changes made over time
Git vs GitHub: Understanding the Relationship
Understanding the relationship between Git and GitHub helps clarify their roles:
Git:
- Version control software that developers use on their computers
- Tracks changes locally on your machine
- Operates through command-line tools
- Manages file history on your local computer
GitHub:
- A website service that hosts Git repositories online
- Provides a cloud-based location to store your code
- Enables you to share code with others
- Allows access from any computer with internet access
Think of it this way: Git is the engine that performs version control work, and GitHub is the service that hosts and enhances Git repositories with web-based features and collaboration tools.
For more information, see GitHub's glossary of Git and GitHub terms.
Why GitHub Matters for Web Development
GitHub matters for web development because it provides several important benefits that enhance your ability to create and share websites:
1. Backup Storage
GitHub serves as backup storage for your code. If your computer crashes or files become corrupted, your code remains safely stored on GitHub's servers.
2. Easy Sharing
GitHub makes it easy to share your projects with others, whether for:
- Collaboration with others
- Portfolio purposes - showcasing your work
- Getting feedback from peers or instructors
3. Free Website Hosting
GitHub provides free website hosting through GitHub Pages, allowing you to publish HTML and CSS websites online without paying for web hosting services.
4. Professional Development Practices
Using GitHub demonstrates professional development practices that employers and collaborators value, showing you understand industry-standard tools and workflows.
GitHub for Learning Web Development
For learning web development, GitHub serves as both a practical tool and a learning opportunity.
Benefits for learners:
- Portfolio creation - Storing your projects creates a portfolio you can share with potential employers, instructors, or collaborators
- Progress tracking - The version history helps you see your progress over time and understand how your projects evolved
- Free hosting - GitHub Pages provides free hosting for static websites, making it easy to publish your HTML and CSS projects
- Complete workflow - Learning GitHub alongside HTML and CSS gives you a complete workflow for creating, storing, and sharing web projects
Key GitHub Concepts
Understanding a few key terms helps you navigate GitHub and use it effectively. These concepts work together to create a system for managing code that scales from simple personal projects to large collaborative efforts.
Repositories
A repository, often shortened to "repo," is a storage location for a project on GitHub. Each repository contains:
- All the files for one project
- The complete history of changes made to those files over time
- Documentation and project information
Public vs Private:
- Public repositories - Visible to anyone on the internet
- Common for learning and portfolio projects
- Allow you to share your work and demonstrate your skills
- Private repositories - Only visible to you and people you specifically invite
- Useful for personal projects or work in progress
Commits
A commit is a snapshot of your project at a specific point in time. When you make changes to files and save those changes to GitHub, you create a commit that permanently records:
- What changed (which files were modified)
- When it changed (timestamp)
- Why it changed (your commit message)
Commits are the building blocks of version control, allowing you to:
- Track your project's evolution
- Return to previous versions if needed
- Create a historical record of your project's development
Each commit includes the files as they existed at that moment, creating a permanent record that can't be accidentally overwritten.
Branches
A branch is an independent line of development that allows you to work on different versions of your project simultaneously.
The Main Branch:
- Typically called
"main"or"master" - Represents the primary, stable version of your project
- This is your working, tested code
Creating Additional Branches:
You can create additional branches to:
- Experiment with new features
- Try different approaches to your design
- Work on multiple tasks in parallel
All while keeping your main branch stable and functional. When you're ready, you can merge changes from branches back into the main branch.
Think of branches like alternate timelines - you can test ideas without risking your working version.
How These Concepts Work Together
Understanding repositories, commits, and branches provides the foundation for using GitHub effectively, whether you're working alone or collaborating with others.
- Repositories store your projects
- Commits track changes over time
- Branches let you work on multiple versions safely
These concepts scale from simple personal projects to large collaborative efforts, making GitHub powerful for projects of any size.
Creating Your GitHub Account
Creating a GitHub account is straightforward and free. The process requires only an email address and takes just a few minutes. Once you have an account, you can create unlimited repositories for your projects, whether they're private for personal use or public to share with others.
Visit github.com in your web browser. On the homepage, you'll see a sign-up form asking for a username, email address, and password. Choose a username carefully because it will be part of your GitHub profile URL and visible on all your projects. Many developers use their real name or a professional variation, while others create a unique handle that represents them online. Your username can be changed later, but it's better to choose something you'll want to keep long-term since changing it can break links to your repositories and requires updating references elsewhere.
Use an email address you check regularly, as GitHub will send important notifications about your repositories, security alerts, and collaboration requests to this address. You can add additional email addresses to your account later if needed. Choose a strong password following GitHub's requirements, which include minimum length and complexity rules. GitHub also supports two-factor authentication for additional security, which you can set up after creating your account.
After entering your information, GitHub will send a verification email to confirm your email address. Click the verification link in the email to activate your account. You may also be asked to verify you're human through a captcha. Once verified, you'll complete a brief setup process where GitHub asks about your experience level and interests. These questions help GitHub customize your experience, but your answers don't limit what you can do on the platform.
After account creation, take a moment to explore your profile page. This is where others will see your projects and contributions. You can add a profile picture, write a short bio describing your interests and skills, and link to your website or social media profiles. While optional, these details help establish your professional presence on GitHub, especially if you plan to use GitHub as part of a portfolio for job applications or academic submissions.
Next Steps
Once you have a GitHub account, you're ready to create your first repository and start storing your HTML and CSS projects. The next guide, "Creating Your First Repository," walks through the process of setting up a repository and uploading your files. Having your code on GitHub opens possibilities for collaboration, backup storage, and eventually publishing websites using GitHub Pages.
Bibliography
GitHub. "Getting Started with GitHub." GitHub Guides. https://guides.github.com/
GitHub. "Signing up for a new GitHub account." GitHub Docs. https://docs.github.com/en/get-started/signing-up-for-github/signing-up-for-a-new-github-account
Pro Git Book. "Getting Started - What is Git?" Pro Git. https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control
The Odin Project. "Introduction to Git." The Odin Project Curriculum. https://www.theodinproject.com/paths/foundations/courses/foundations