Android深度探索HAL与驱动开发3

                       Android深度探索HAL与驱动开发

                                  第三章

                                Git使用入门

                                 读书笔记

Git是对源代码进行管理的软件。

一、安装Git

# apt-get install git

# apt-get install git-doc git-emall git-gui gitk

用以下命令控制Git

# apt-get install git-core

# apt-get install git-doc git-svn git-email git-gui gitk

 

二、查看Git文档

查看git-checkout命令文档:

# git help git-checkout

查看HEML格式文档:

# git help -w git-checkout

 

三、源代码的提交与获取

1、使用git clone命令在本地创建一个空的版本库:

# mkdir -p/demo/helloworld-git

# cd /demo/helloworld-git

# git init

2、将文件提交到本地版本库:git commit

# cd /demo/helloworld-git

# echo “helloworld”>helloworld.txt

# git add helloworld.txt

# git commit -m ‘helloworld-master’

-m命令行参数是本次提交的备注;

3、创建本地分支:git branch

# git branch                查看本地分支

# git branch new-branch      新建分支

# git branch -D new-branch    删除刚建立的分支

4、切换本地分支:git checkout

# git checkout new-branch     将本地分支切换到new-branch

修改helloworld.txt文件内容并重新提交到本地版本库

# echo ‘世界你好’>helloworld.txt

# git add helloworld.txt

# git commint -m helloworld-new-branch

5、在GitHub上创建开源项目

6、上传源代码到GitHubgit push

上传前先备份

# ssh-keygen -t rsa -C hellloworld@126.com

上传文件前需要使用git config命令设置上传这的名字和email

# git cinfig --global user.name “Your Name”

# git config --global user.email helloworld@126.com

使用git remove命令设置helloworld工程在GitHub上的URI

# git remove add orign git@github.com:androidguy/helloworld.git

7、从GitHub下载源代码:git clone

使用下命令下载整个工程

# git clone git@github.com:androidguy/helloworld.git

 

四、小结

五、学习Git的用法。

 

posted @ 2016-05-02 21:09  钱文海  阅读(59)  评论(0编辑  收藏  举报