Creating a GitHub Repository
Creating a repository on GitHub is the starting point for sharing and collaborating on code. You can start fresh on GitHub and clone down, or connect an existing local project to a new GitHub repo.
01.Two Approaches to Creating a Repo
Approach A (existing local project): Create an empty repo on GitHub with no files, copy the remote URL, add it as origin in your local project, push. Approach B (starting fresh): Create the repo on GitHub with a README and .gitignore, then clone it to your machine and start coding. Both are valid — pick based on your situation.
02.Key Settings When Creating
Public: visible to everyone — great for open source and required for free GitHub Pages hosting. Private: only you and collaborators can see it. README.md: a markdown file describing your project (always add this). .gitignore: tells Git to ignore build outputs, node_modules, .env files, and OS junk. LICENSE: essential for open source — without it, no one can legally use your code.
Commands
What does a .gitignore file do?