GIT使用入门
********************
Linux内核代码及很多著名的项目都使用Git进行源代码管理
了解Git的理论和基本使用方法会有助于获取更多的学习资源

///////////////////////////////////////////
安装GIT:
很多Linux系统自带GIT,如果没有,需要自行安装。
方法:
# apt-get install git
# apt-get install git-doc git-svn git-email git-gui gitk
//////////////////////////////////////////////////////////
查看GIT文档:
1.直接用man命令查看指定命令的帮助文档
2.安装git-doc后会安装git的文本格式和HTML格式的文档
以文本形式查看命令:# git help <sub-command>
3.查询git-checkout命令的文档: #git help git-checkout
若想看HTML格式的: # git help -w git-checkout
///////////////////////////////////////////////////////
源代码的提交与获取:
1.建立一个开源项目的工作目录:# mkdir -p /demo/helloworld-git
2.进入该工作目录:# cd /demo/helloworld-git
3.执行:# git init(输出:Initialized empty Git repository in /demo/helloworld-git/.git/)
4.# ls -al
5.将文件提交到本地版本库:
# cd /demo/helloworld-git
# echo "helloworld" > helloworld.txt
# git add helloworld-master
# git log
6.创建本地分支:git branch
# git branch
# git branch new-branch
# git branch -D new-branch
7.切换本地分支:
# git checkout new-branch
8.在GitHub上创建开源项目
9.上传源代码到GITHub:git push
10.从GITHub下载源代码:git clone

http://www.cnblogs.com/zygoodest/