2017/04/06 - Git tutorial

1.Configuring GitHub

Setup github’s username and email

git config --global user.name "user_name"
git config --global user.email "email_id"

2.Creating a local repository

Go to the directory where you want to do version control

git init

3.Create a README

The README file is generally used to describe what the repository contains or what the project is all about.

4.Adding repository files to an index

git add README

5.Committing changes made to the index

Once all the files are added, we can commit it. This means that we have finalized what additions and/or changes have to be made and they are now ready to be uploaded onto our repository.

git commit -m "message"

6.Creating a repository on GitHub

Create a repository on GitHub. Notice that the name of the repository should be the same as the repository’s on the local system.

Once this is created, we can push the contents of the local repository onto the GitHub repository in your profile. Connect to the repository on GitHub using the command

git remote add origin https://github.com/user_name/Mytest.git

7.Pushing files in local repository to GitHub repository

The final step is to push the local repository contents into the remote host repository (GitHub), by using the command

git push origin master

Some commands

Add all files

git add -A

Add all changed files

git add -p

Summary

I have used some version control system such as RCS, CVS, SVN , and now I learned another one : GIT. Github is a famous platform around the world, so this time I want to learn how to use it to manage my project. This is my project on github.