Creating Your GitHub Account
GitHub is where you store and share your projects in the cloud. If you don't have an account yet, create one now:
- Go to github.com and click Sign up
- Fill in your email, password and choose a username
- Confirm the email sent to your inbox
Done. Now let's put your first project up there.
Setting Up Your SSH Key
An SSH key connects your computer to GitHub without needing to type a password every time. Set it up before creating your repository.
1. Generate the key
ssh-keygen -t ed25519 -C "your.email@example.com"Press Enter on all prompts to use the default values.
2. Copy the public key
Linux/macOS:
cat ~/.ssh/id_ed25519.pubWindows (PowerShell):
Get-Content ~/.ssh/id_ed25519.pub3. Add it to GitHub
- Go to github.com/settings/keys
- Click New SSH key, paste the key and save
4. Test the connection
ssh -T git@github.comIf you see "Hi username! You've successfully authenticated", you're all set.
Your First Repository
A repository is your project folder with the full change history saved by Git. Let's create one from scratch and publish it on GitHub.
1. Create a folder and initialize Git
mkdir my-projectcd my-projectgit init2. Create a file
echo "# My Project" > README.md3. Add and make your first commit
git add .git commit -m "first commit"4. Create the repository on GitHub
- Go to github.com/new
- Name the repository — use the same folder name:
my-project - Set it as Public and click Create repository
- Don't check any extra options (README, .gitignore, license) — the repository must be empty
5. Connect your local repo to GitHub and push
GitHub will show these commands after you create the repository. Copy and paste them in your terminal:
git remote add origin git@github.com:your-username/my-project.gitgit push -u origin mainReplace your-username with your GitHub username.
Refresh the repository page on GitHub — your README.md will already be there. 🎉
Now that your first repository is live, feel free to explore other projects. Follow me on GitHub to see what I'm building: github.com/ecodelearn
Cloning an Existing Repository
To download a project that already exists on GitHub to your computer:
git clone git@github.com:username/repository.gitThis creates a local folder with all the project content and history, ready for you to work on.