1.1 Getting the Source Tree

来源:互联网 发布:淘宝网儿童保护电插头 编辑:程序博客网 时间:2024/05/22 15:33

转载自: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$ lsBUILD            COPYING             libmysqld    regex          testsBUILD-CMAKE      dbug                libservices  scripts        unittestclient           Docs                man          sql            VERSIONcmake            extra               mysql-test   sql-bench      vioCMakeLists.txt   include             mysys        sql-common     wincmd-line-utils   INSTALL-SOURCE      packaging    storage        zlibconfig.h.cmake   INSTALL-WIN-SOURCE  plugin       stringsconfigure.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.6Branch 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.5Branch 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.


原创粉丝点击