zoukankan      html  css  js  c++  java
  • 第三章

    第三章

    为了减小发行包的大小,对源代码进行管理。AndroidLinux内核、驱动开发的过程中会涉及到大量的源代码,而这些代码都是由Git管理的,本章即介绍了Git的理论和基本实用方法。

    安装Git

    # apt-get install git

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

    该命令都是在root用户下完成的,必须使用root权限才能执行命令,可以在命令前加sudo,之后输入密码,输入正确后可以执行。

    查看Git文档

    # man git-checkout

    以文本形式查看# git help <sub-command>

    查询命令的文档

    # git help git-checkout

    查看HTML格式的文档

    # git help -w git-checkout

    源代码的提交与获取有以下步骤:

    1)创建版本库git init

    #mkdir -p /demo/helloword-git

    #cd /demo/helloword-git

    #git init

    现在就建立了一个空的版本库。在源代码中有一个隐藏的.git目录。之后不断的操作这个本地版本库,会修改.git目录中的相关子目录和文件的内容。

    (2)将文件提交到本地版本库git commit

    在目录下建立一个helloworld.txt

    # cd /demo/hello-git

    # echo “helloworld” > helloworld.txt

    helloworld.txt文件提交到版本库

    # git add helloworld.txt

    # git commit  -m ‘helloworld=master’

    #git log

    (3)创建本地分支

    #git branch了解当前版本

    #git branch new-branch建立一个新的分支

    #git branch -D new-branch

    (4)切换本地分支 git checkout

    #git checkout new-branch

    #git add helloworld.txt

    #git commit -m hello

    (5)在GitHub上创建开源项目

    (6)上传源代码到GitHubgit push

    (7)从GitHub下载源代码:git clone

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

  • 相关阅读:
    PHP 快速实现大文件上传
    websocketd
    mybatis——一级缓存、二级缓存
    mybatis学习——多对一和一对多查询
    XML文件存在中文注释报错问题( 3 字节的 UTF-8 序列的字节 3 无效)
    mybatis设置自动提交事务
    mybatis之Param注解
    mybatis学习——实现分页
    mybatis学习——日志工厂
    mybatis——解决属性名和数据库字段名不一致问题
  • 原文地址:https://www.cnblogs.com/BJBLOG/p/5439104.html
Copyright © 2011-2022 走看看