Lesson

GitHub Get Started

10 min reading
Free Course

GitHub Get Started: Hosting Your Code in the Cloud

GitHub is a web-based hosting platform built around Git repositories, adding cloud backups, pull requests, issue tracking, and automated CI/CD workflows. While Git tracks commits on your local machine, GitHub stores a shared copy online so teammates and contributors can collaborate from anywhere.

Creating Your Account and First Repository

Sign up for a free account at github.com using the same email address you configured in git config user.email. Matching emails ensures your pushed commits display your profile avatar and contribution graph accurately.

Once signed in, click New on your dashboard to create a repository:

  • Repository name: Use lowercase letters and hyphens, such as starter-site.
  • Visibility: Pick Public for open-source portfolios or Private for personal and company apps.
  • Initialize options: Leave README, .gitignore, and LICENSE unchecked if you already initialized a local Git repository with git init.

Connecting Local Git to GitHub

After creating an empty repository, GitHub shows a setup screen with your repository URL. Inside your local starter-site folder, verify your branch is named main, link the remote URL, and push your commits:

git branch -M main
git remote add origin git@github.com:your-username/starter-site.git
git push -u origin main

Refresh your GitHub browser tab, and your index.html, styles.css, and commit history appear online right away.

Choosing a License and README

Every public repository benefits from a clear README.md explaining what the project does and how to run it locally. Adding an open-source license file such as MIT tells other developers explicitly how they may reuse or modify your code.

Common Beginner Mistakes

Checking "Add a README file" on GitHub when you already have commits locally creates a divergent remote history. If that happens, git push fails until you run git pull origin main --allow-unrelated-histories or create an empty repository without initial files.

Frequently Asked Questions

Is GitHub free for private repositories?

Yes. GitHub's free plan includes unlimited public and private repositories with collaborators, pull requests, and monthly GitHub Actions minutes.

Can I upload files directly in the GitHub browser?

Yes, you can drag and drop files in the web interface for quick tests. However, learning local git add, git commit, and git push is essential for real projects and multi-file edits.

What is the difference between GitHub, GitLab, and Bitbucket?

All three host standard Git repositories and run the same Git CLI commands. They differ mainly in built-in CI/CD tooling, enterprise hosting options, and pricing tiers.

Save Your Progress

Unlock Your
Full Potential.

Sign in to track your learning journey, earn industry-recognized certificates, and join our elite developer community.

Quick Access With

Enterprise-Grade Security Protocol
Git Topic Hub

Stuck on this lesson?

Join our community of senior developers.

Ask in Forum