Working with GitHub — Sharing Code with the World
Learn how to push your code to GitHub, clone other projects, and collaborate with other developers online.
Git + GitHub = Superpowers
Pushing to GitHub
# 1. Create a repository on github.com first
# 2. Then connect your local project to it:
git remote add origin https://github.com/yourusername/myproject.git
# 3. Push your code to GitHub
git push -u origin main
# After the first push, just use:
git push
# To download a project from GitHub:
git clone https://github.com/someone/cool-project.git
# To get the latest changes from GitHub:
git pullCloning and Forking
Your GitHub profile is your coding resume. Keep your repositories organized, write good README files that explain your projects, and make regular commits to show you are actively coding. Many companies and schools look at GitHub profiles when evaluating candidates!
If you do not have a GitHub account, create one at github.com (it is free!). Then: 1) Create a new repository called 'my-first-repo'. 2) Push a local Git project to it using the commands above. 3) Visit your project page on GitHub and check that your files are there. 4) Find an interesting open-source project and clone it to your computer. Explore the code! Bonus: Add a README.md file to your project explaining what it does.
Ready to build?
Put what you learned into practice — pick a project and start coding.
Start Building Free