Git and GitHub for beginners
In this article, you will learn how to use git, how to create GitHub repository and push code, create README file etc. So let’s begin…
How do we get the codebase from existing repository on GitHub?
Write a command in command prompt/ terminal
git clone “your URL to repository in GitHub”
for this make sure you have your repository link availble or get how I did below in screenshot
How to create a new repository in GitHub?
Login with credtials at
and then right click on top-right corner on + icon and then you will get option like
Now click on New repository, once clicked on then you will get the page like below
Now here you should enter Repository name and description of the project (optional), if you want a private repository then go for private radio check else default repository will be public.
You have option to check Add a README file or you may add later on as well. Finally click on Create Repository
Once clicked on Create Repository, you will get a screen like below with lots of commands to do, so now it’s time to open your terminal/ source tree(UI interface for GitHub) and follow the steps one by one.
So let’s go to you project folder and then right click on it to open terminal
Step 1 : Initialization of repo, write command git init
Everything starts from here. The first step is to initialize a new Git repo locally in your project root. You can do so with the command below
Step 2 : Add all file to repo, Write git add .
Step 3: Now let’s add the repository link, for this go to github page where you have your repository created and copy the repository link to add
and then go back to command terminal and paste this command
Step 4: Commit codebase , write command git commit -m “your message”
You can add a commit message without opening the editor. This command lets you only specify a short summary for your commit message.
Step 5 : Push the codebase, write command git push
Finally you finished your code publish part, now got to github and refresh it, check should have your codebase their
How to add Readme file?
Click on Add a README and then write your about details for project
Now commit the changes, by clicking Commit new file and it will look like below
Thank you for reading my article. I really appreciate 👏 your response.
Clap if this article helps you. It means a lot to me. If I got something wrong, please comment for improve.
let’s connect on Linkedin , GitHub