How to push code into Github
It works on my machine.
In order to get started with this process, first we have to install Git on the system. For that simply go to Google and type install Git.
Now, click onto Downloads-Git option. After that select your respective system whether being Windows or MacOS etc. The download will start, once you’ll click the download option.
After that, open that exe file and install git onto your system. Once, the installation takes place now it’s time to create a Github profile. For that just go to github.com.
Then, click the sign up button.
You need to sign up using your email I’D. Then choose your password and you are good to go.
Once, your profile is created you will be welcomed on your homepage. You can customize your page the way you want.
Now, you have to click on + icon and then select the New repository Option from the drop down list.
After clicking the New repository option this main page will appear.
You give your repository a name. Then, it’s optional whether you want to give project a description or add any readme file or gitignore file.
You can select between public or private option depending upon whether you want to display your projects or want to keep it private.
Then, you have to keep all the files together in a single folder that you want to push on Github. Then, right click and select git bash here option.
Once, that option is selected, a command prompt terminal would appear.
Now, you have to type few commands in order to get the task done. Starting with :-
- git init
- git add .
- git commit -m “Initial Commit”
- git remote add origin https://
For 4th command you select the https link provided on the page. Just copy and paste that link on the terminal window.
Just make sure that you have pasted the https link by clicking right and then select the paste option. Ctrl C and Ctrl V will not work on the terminal window.
Now, proceed for the final command.
5. git push -u origin master
Once the last command is executed. You have to go back on the github page and refresh it. After you refresh the page you’ll be able to view all the files that you have pushed into the github.
Thanks for visiting…