1.1 Getting the Source Tree

转载自:https://dev.mysql.com/doc/internals/en/getting-source-tree.html

This section describes how to obtain the MySQL source tree, which is currently available on GitHub.

MySQL officially joined GitHub in September, 2014. For more information about MySQL's move to GitHub, refer to the announcement on the MySQL Release Engineering blog: MySQL on GitHub

To obtain the MySQL source tree from GitHub, perform the following steps:

  1. Clone the MySQL Git repository to your machine. The following command clones the MySQL Git repository to a directory named mysql-server. The download size is approximately 437 MB.

    me@mymachine:~$ git clone https://github.com/mysql/mysql-server.git 
    Cloning into 'mysql-server'...
    remote: Counting objects: 1035465, done.
    remote: Total 1035465 (delta 0), reused 0 (delta 0)
    Receiving objects: 100% (1035465/1035465), 437.48 MiB | 5.10 MiB/s, done.
    Resolving deltas: 100% (855607/855607), done.
    Checking connectivity... done.
    Checking out files: 100% (21902/21902), done.
  2. When the clone operation completes, the contents of your local MySQL Git repository appear as shown:

    me@mymachine:~$ cd mysql-server
     
    me@mymachine:~/mysql-server$ ls
    BUILD            COPYING             libmysqld    regex          tests
    BUILD-CMAKE      dbug                libservices  scripts        unittest
    client           Docs                man          sql            VERSION
    cmake            extra               mysql-test   sql-bench      vio
    CMakeLists.txt   include             mysys        sql-common     win
    cmd-line-utils   INSTALL-SOURCE      packaging    storage        zlib
    config.h.cmake   INSTALL-WIN-SOURCE  plugin       strings
    configure.cmake  libmysql            README       support-files          
  3. Your MySQL Git repository contains MySQL 5.5, 5.6, and 5.7 branches. Run the git branch -r command to view the remote-trackingbranches:

    ~/mysql-server$ git branch -r
      origin/5.5
      origin/5.6
      origin/5.7
      origin/HEAD -> origin/5.7
  4. Run the git branch command to view branches that are currently checked out locally. When you cloned the MySQL Git repository, the MySQL 5.7 branch was checked out automatically. The asterisk identifies the 5.7 branch as the active branch.

    ~/mysql-server$ git branch
    * 5.7
  5. To check out the other MySQL branches, run the git checkout command, specifying the branch name:

    ~/mysql-server$ git checkout 5.6
    Branch 5.6 set up to track remote branch 5.6 from origin.
    Switched to a new branch '5.6'
    
    me@mymachine:~/mysql-server$ git checkout 5.5
    Branch 5.5 set up to track remote branch 5.5 from origin.
    Switched to a new branch '5.5'
  6. Run git branch again to verify that all three branches are present. MySQL 5.5, which is the last branch you checked out, is marked by an asterisk indicating that it is the current branch.

    ~/mysql-server$ git branch
    * 5.5
      5.6
      5.7

    To switch branches, run git checkout again. For example, to make MySQL 5.6 the active branch, run git checkout 5.6.

For more information about working with and maintaining Git repositories, refer to GitHub Help.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值