In this article we will see the process to connect git to GitHub.
How to Connect Git to Github?
Github is a very popular version control system. We can use it to store our local git commits and access them anywhere with an internet connection.
To push a repo to github
- Visit github.com
- Login with your credentials
- Click the new repository button which will bring you to a page like this
- After filling in the required fields create the repository
- Now click “Push an existing repository”
- In the git terminal on your machine
$ git remote add origin https://github.com/username/new_repo
- Enter your password then set the branch to main
$ git branch -M main
- Push the branch
$ git push -u origin master
- After successful pushing, we will have