Push To GitHub - Codecademy
Maybe your like
Related learning
- Free course
Learn Git: Introduction
Learn how to track changes in your code and switch between different versions with Git, an open-source version control system.- Checker DenseBeginner Friendly.1 hour
- Free course
Using Git for DevOps: Using Git Effectively
Become proficient in Git for DevOps, including repository management, Git commands, GUI, distributed workflows, branching, Git server protocols, and Gitflow.- Checker DenseIntermediate.1 hour
Background
When developing an app, here’s a common approach:
- You’re working with some new code to get it to work
- You don’t want to break your existing code, so you copy your current code to another folder (Folder A) and continue working in Folder B
- If you make a mistake, you just delete Folder B and resume with Folder A
This approach is the idea behind version control. Version control is a process that lets you keep checkpoints of your code so that you can refer back to them if needed.
Git is a widely-used version control system used to manage code. Code managed with Git is called a Git repository.
GitHub is popular hosting service for Git repositories. With GitHub, you can share your code and collaborate with others.
Instructions
In your project, initialize a Git repository:
$ git initCopy to clipboardCheck the status of which files and folders are new or have been edited:
$ git statusCopy to clipboardTell Git to start tracking your files and folders:
$ git add .Copy to clipboardIf you want to track a single folder or file, use its name:
$ git add app/ $ git add config/routes.rbVerify that everything was committed correctly:
$ git statusSave the changes you made, with a message describing what changed:
$ git commit -m "Initial commit"On GitHub, create a new repository with a short, memorable name:

After creating a repository, copy the git commands under the “…or push an existing repository from the command line”, and paste them into the terminal. These commands will add a remote repository, and then push your local repository to the remote repository.
Want to learn more? Check out our course on Git and GitHub.
'The Codecademy Team, composed of experienced educators and tech experts, is dedicated to making tech skills accessible to all. We empower learners worldwide with expert-reviewed content that develops and enhances the technical skills needed to advance and succeed in their careers.'
Meet the full team ShareRelated articles
- Article
Set Up with Git and GitHub
Learn how to install Git, configure it, and connect to GitHub to manage your code with version control and collaboration. - Article
Git Setup for Mac and Windows Computers
Never fear losing work with this professional versioning system - Article
How to Use Git: A Step-by-Step Tutorial
Learn how to use Git efficiently to track changes in your code, collaborate with others, and simplify your development process. Master version control with our step-by-step guide!
Learn more on Codecademy
- Free course
Learn Git: Introduction
Learn how to track changes in your code and switch between different versions with Git, an open-source version control system.- Checker DenseBeginner Friendly.1 hour
- Free course
Using Git for DevOps: Using Git Effectively
Become proficient in Git for DevOps, including repository management, Git commands, GUI, distributed workflows, branching, Git server protocols, and Gitflow.- Checker DenseIntermediate.1 hour
- Course
Learn Git & GitHub
Use our beginner friendly Git course to integrate Git and GitHub and manage versions of your projects using Git branches.- Checker DenseWith Certificate
- Checker DenseBeginner Friendly.4 hours
Tag » How To Push In Github
-
GIT Push And Pull Tutorial - DataCamp
-
Adding Locally Hosted Code To GitHub
-
Pushing Commits To A Remote Repository - GitHub Docs
-
Git Guides - Git Push - GitHub
-
How To Push An Existing Project To GitHub - DigitalOcean
-
[GitHub] How To Push To GitHub | Learn Version Control With Git
-
How To Git Push An Existing Project To GitHub - The Server Side
-
How To Push Code To Github - YouTube
-
Pushing A Project To GitHub - CircleCI
-
How To Push To GitHub - Zapier
-
Git Push | Atlassian Git Tutorial
-
Pushing To Github - Made Simple Enough For Poets - FreeCodeCamp
-
Git Push Command Explained With Demo [Updated] - Simplilearn
-
Git Push To GitHub - W3Schools