$ sudo apt-get install git
Sign Up on github.com
Click here to sign up on github.com.
Create SSH Key
$ ssh-keygen -t rsa -C "email@example.com"
id_rsa.pub will be created under
/home/.ssh folder while
id_ras is private key and
id_rsa.pub is public key. Sign in github, and enter
personal settings->SSH and GPG Keys. Click
New SSH Key. Copy the content in
id_rsa.pub and paste here.
Usage of git
$ git init
Check the status of local repository
$ git status
Add changes to repository
$ git add file1name file2name ...
Add all changed files
$ git add .
$ git commit -m "comments come here"
Add remote repository
$ git remote add origin firstname.lastname@example.org:XXXX/XXXXXX.git
Use the command
$ git remote -v
to check the remote repository that you just added.
$ git push -u origin master
origin is the name of remote repository and
master is the name of local repository.
When the remote repository is empty, add
-u parameter in the command, otherwise not.
$ git push origin master
$ git clone email@example.com:XXX/nameRepo.git
A new folder that has the same name as repository, like
nameRepo here will be created and all the files will be cloned in this folder.
If you want to clone the repository to another folder, add a
destination path after this command, like this
$ git clone firstname.lastname@example.org:XXX/XXXXX.git destination
Note that no Chinese characters in repository path and do not use share folders between VMware and host in your repository path!!!