How To Create git Repository in github

Github is a popular online version control System.  Most of IT Persons are using github to maintain their software versions. We can easily manage our software version with github version controlling System. We Can Manage Several Branches of our Software.

In This Tutorial I am going to Show you How to be familiar with github version Control System. First of All, You need to Create Account in www.github.com. Then You can Create github Repository.


Github Repository is a repository to maintain your software versions. In Your github dashboard, There is a New Repository Button. Click on it !
After Clicking on New Repository Button, You will redirect to Edit Repository Details page. In This page you have to type details of your New repository.

1. Add Repository Name
2. Add Some Description about your Repository.
3. Click on Public

If You Click On public, your Repository will see other github users and they can get downloaded your codes in the repository. To avoid this, you have to click private radio button  and get it private. To keey your Repository as private one, you need to pay for it. Once you click on priate radio button, Card details fields are appeared.
If You want to create private repository, Enter card details to pay for repository. I am going to create public repository. so i do not need to enter my Card details. :)

After Entering necessary details, Click on Create Repository Button. Your Repository has been Created !
You will redirect to below page. Copy the link.(Highlighted link)
Go to your Git Shell. If you not installed git shell, go to this link and install git shell. Go to your Hard Drive partion. I am going to get git repository to my F Drive in my Hard Disk. So I cd to my F drive. Then Type following git command
git clone <your-repository_link>

In my Example:
 git clone https://github.com/chinthakabc/mytestRepo.git

Press Enter.
 Your Repository is cloned to your hear Drive. In my Example, My repository is cloned to my F: Drive in the Hard Disk. See the below Image.
Add your Project source Files to this folder. I have added bs.html file.
Go back to the Git Shell. Type Following git Command to add files to be commited.
git add <file-name>

If you have plenty of files to be commited, change git command as follows.
git add --all
or
git add .

See the below output. If you do not know which command to be typed in git shell, type git status. Git shell says that which command/s to be typed. I have simply typed git status command. it says that type git add command. So I Typed git add Command
You added files to git and now you have to commit these files to git repository. Type following git command to commit your files to git repository.
git commit -m "git message to commit"

git message can be seen in the github repository. This message useful to send some useful data like which number of commit, what is the purpose of this commit...etc.

In my Example :
git commit -m "My First Commit"

You have Successfully committed your files to git repository. Remember that, these files are still in the locally. Not updated in your git repository in github website. your need to push these files to github website (online git repository).
Type following Command to push your files to online repository in github.
git push

Now you can see your files in github online repository.
1. File/s, you have commited.
2. your committed message

Have a Fun with git Command and git repository.... !

0 comments:

Post a Comment

Ask anything about this Tutorial.