There are simple steps to push your own code onto Github without any further or additional searches on Google.
“Github is a version controlling system to control all the versions of your code and better working experience with the group of developers or a team. ”
Now back to the point and without further more delay let’s push your code on Github.
Create an account on Github.
If you already created an account on GitHub then you can move to the further process or if you do not have an account on GitHub then go to https://github.com and click on signup using your personal email and create an account. Yeah🌟
Goto the repo and create a repo and give it the name of your project like “github_exmaple”
In the description section, you can describe the project. What is the project about your project how it works benefits and requirements like that?
Then finally create a repo to click the create.
Now in your system open the terminal and type these commands.
It’s simple just enter your name as well as enter your email that is using in Github.
git config— global user.name “your name”
git config — global user.email “your email”
NOTE:- “ if you’re already done these steps then move to another section. “
Go to your project dir and in the dir open the terminal/cmd. And follow these steps
- Initialize the git
- Adding the files (all files you select & add)
git add .
- Adding the files (some specific files you want to select & add)
- Then committing a message. (For your and other developers are understand what you change in the code for this particular commit)
git commit — m “any message here”
- Add the origin repo in your local machine.
git remote add origin “https://github.com/your_profile/your_repo.git”
- And finally, push your code on the Github.
git push — u origin master
NOTE:- “ if you’re facing some problems with final pushing cmd then you forcefully push the code. Don’t worry it’s safe. ”
git push — u origin master — force
What it’s done congratulations✨ you’ve to push your first code on GitHub.