The best way to learn is trying it. HERE is a interactive website link.
Git is a distributed revision control and source code management system with an emphasis on speed. Git was initially designed and developed by Linus Torvalds for Linux kernel development.
$ sudo apt-get install git-core
$ git config --global user.name [name]
$ mkdir git_folder
$ git clone email@example.com:project.git
$ git add .
This snapshot is now stored in a temporary staging area which Git calls the “index”. You can permanently store the contents of the index in the repository with git commit:
$ git commit
This will prompt you for a commit message.
Or just use
-m to set commit message directly.
$ git commit -m [message]
You’ve now stored the first version of your project in Git.
At any point you can view the history of your changes using
$ git log
A single Git repository can maintain multiple branches of development.
To create a new branch named “experimental”, use
$ git branch experimental
If you now run
$ git branch
you’ll get a list of all existing branches:
The “experimental” branch is the one you just created, and the “master” branch is a default branch that was created for you automatically. The asterisk marks the branch you are currently on; type
$ git checkout experimental
to switch to the experimental branch.
The Push operation stores data permanently to the Git repository.
$ git push origin master
The Pull operation will retrieve the data from repository.
$ git pull
Further update to be continued