In this blog post, I will show you how to push a local repository to GitHub from a Linux machine.
I will break down the process to two. First, I will create a repository on my machine.
After creating it on my machine, I will create another one on Github with the same name.
The final step will be pushing the local repository to GitHub.
On my Linux machine, I will create a repository using the commands below.
git add .
git commit -m "first repo"
The name of the repo is 3.Repo.
Create a new repository on GitHub
I will move on to the GitHub website and create a new repository with the same name.
I will make it private and will leave the settings as shown below.
After clicking Create, I will note down the repository URL.
In the final step, I will add the repository URL to the following command and push it.
git remote add origin https://github.com/urlofrepo.git
git push -u origin master
You can see the final results below.