Git & Github

1. Git and GitHub simple text description

Git is an open source distributed version control system, which is used to handle project version management of various scales efficiently and at high speed. It is an open source version control software developed by Linux Torvalds to help manage the development of the Linux kernel. usage of.

 

GitHub can host various git repositories and provide a web interface, but unlike other services like SourceForge or GoogleCode, GitHub's unique selling point is the ease of forking from another project. Contributing code to a project is very simple: first click the "fork" button on the project site, then check out the code and add the changes to the code base just forked, and finally be responsible to the project through the built-in "pull request" mechanism People apply for code merge. Some people have already called GitHub the MySpace for code players.

 

2. Install Git on Windows

Download msysgit ( http://code.google.com/p/msysgit/ ), keep the default options during installation, do not use putty as a client, GitHub only supports openssh. After installation, you need to generate an SSH Key.

 

3. Configuration

3.1 Check if KEY already exists

 

$ cd ~/ .ssh
$ ls
config id_rsa id_rsa.pub known_hosts
$ mkdir key_backup
$ cp id_rsa
* key_backup
$ rm id_rsa
*

 

If there are already KEYs (id_rsa, id_rsa.pub), copy them to the key_backup directory for backup, because SSH will use the KEY in the ".ssh" directory by default

 

3.2 Generate SSH KEY

 

code
$ ssh-keygen -t rsa -C "[email protected]"
Enter file
in which to save the key ( / c / Users / Tekkub / .ssh / id_rsa):
Enter passphrase (empty
for no passphrase):
Enter same passphrase again:
Your identification has been saved
in / c / Users / Tekkub / .ssh / id_rsa.
Your
public key has been saved in / c / Users / Tekkub / .ssh / id_rsa.pub.
The key fingerprint
is :
e8:ae:
60 :8f: 38 :c2: 98 :1d:6d: 84 : 60 :8c:9e:dd: 47 : 81 [email protected]

 

Here you will be asked to enter the key directory and password, which can be entered according to your own situation.

 

3.3 Add Public Key to GitHub

Open your GitHub->SSH Public Key->click "Add another public key", copy the content of your public key (id_rsa.pub) to GitHub

 

3.4 Testing

 

$ ssh [email protected]
ERROR: Hi tekkub
! You ' ve successfully authenticated, but GitHub does not provide
shell access
Connection to github.com closed.成功!!


 

 

4. 下载你的项目

$git clone git://github.com/schacon/simplegit.git

 

5. 提交变更

5.1 配置

  git config --global user.name "Your Name"
  git config --global user.email [email protected]

 

5.2 创建Repository

 

1 mkdir clrs
2 cd clrs
3 git init
4 touch README
5 git add README
6 git commit - m ' first commit '
7 git remote add origin [email protected]:your_name / clrs.git
8 git push origin master

 

 

 

 

5.3 提交已经存在的Repository

 

1 cd existing_git_repo
2 git remote add origin [email protected]:your_name / clrs.git
3 git push origin master

 

 

 

 

 

参考

http://gitref.org/   Git参考文档及命令使用

http://help.github.com/ GitHub帮助

http://code.google.com/p/msysgit/

http://samson7b.iteye.com/blog/1424038

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326266503&siteId=291194637