Push/upload git repo to github

In this article let’s discuss about Push/upload git repo to github. Let’s go through the following methods without any delay.

Method 1:

echo "# Can-I-Shop-2" >> README.md
git init
git add .
git commit -m "first commit"
git remote add origin https://github.com/username/projectname.git
git push -u origin master
                

If you are facing any issues with the above approach then try the alternative that is given below. It may look similar but have a try!

Method 2 :

git remote add origin https://github.com/username/projectname.git
#A new repo should be created on GitHub and the url used in the initial upload.

git push -u origin master
#Subsequent command used to upload project. If name of master branch han been
#changed, use that name.

Hope the above solution works.

Realted Posts : How to install pycharm on linux