How to Push Anything to GitHub using Git Bash?



For a beginner, it is a very hectic task to make a GitHub repository and push anything on GitHub, for this we all have seen a lot of videos but it is very time-consuming. So in this article, we are going to see how you can push whatever you want to push on GitHub.

 So let’s start.

Prerequisite: Must have a GitHub account and git bash installed.

Step By Step Implementation:-

Make a GitHub repository by clicking on the “new“ Button




Now after clicking on that, you will see a screen something like as shown below in the image.

Give the name of your repository and give a short description of your repository.
After that just click on the “create repository “ option.



Now go to the local folder that you want to push on GitHub and after a right click a menu will show in which you have to click on “Git bash here”.


After that GitBash will open and now you have to make a clone of the repository that we have just made. We can make the clone by simply writing the command “git clone https://link”. This HTTPS link we will get from our repository.


After opening Git bash First execute these 5 commands:-

- git init

- git add README.md
- git commit -m "first commit"
- git branch -M main
- git remote add origin https://github.com/jpowarpgithub/temp.git


How to get this https:// link??

Just go to your repository and there is an option name “Code” Just click on that and how you are able to see the https:// link so just copy that.


Now we are having the link to go back to the GitBash terminal and type “git clone https://link” and hit enter.
- git push -u origin main


If you get any error after last comment "git push -u origin main"
for that error you can exceute below comment " git remote -v" and execute once again above 5 commnets.

Now go to your repository and there you will find all the files that you have pushed.