zoukankan      html  css  js  c++  java
  • git -- git clone

    • git clone 命令参数:

    usage: git clone [options] [--] <repo> [<dir>]
    
        -v, --verbose         be more verbose
        -q, --quiet           be more quiet
        --progress            force progress reporting
        -n, --no-checkout     don't create a checkout
        --bare                create a bare repository
        --mirror              create a mirror repository (implies bare)
        -l, --local           to clone from a local repository
        --no-hardlinks        don't use local hardlinks, always copy
        -s, --shared          setup as shared repository
        --recursive           initialize submodules in the clone
        --recurse-submodules  initialize submodules in the clone
        --template <template-directory>
                              directory from which templates will be used
        --reference <repo>    reference repository
        -o, --origin <name>   use <name> instead of 'origin' to track upstream
        -b, --branch <branch>
                              checkout <branch> instead of the remote's HEAD
        -u, --upload-pack <path>
                              path to git-upload-pack on the remote
        --depth <depth>       create a shallow clone of that depth
        --separate-git-dir <gitdir>
                              separate git dir from working tree
        -c, --config <key=value>
                              set config inside the new repository
    • 常用的git clone命令:

      1. 最简单直接的命令

    git clone xxx.git

      

      2. 如果想clone到指定目录

    git clone xxx.git "指定目录"

      3. clone时创建新的分支替代默认Origin HEAD(master)

    git clone -b [new_branch_name]  xxx.git

      4. clone 远程分支

      git clone 命令默认的只会建立master分支,如果你想clone指定的某一远程分支(如:dev)的话,可以如下:

      A. 查看所有分支(包括隐藏的)  git branch -a 显示所有分支,如:    

    * master
      remotes/origin/HEAD -> origin/master
      remotes/origin/dev
      remotes/origin/master

      B.  在本地新建同名的("dev")分支,并切换到该分支

    git checkout -t origin/dev 该命令等同于:
    git checkout -b dev origin/dev

      相关链接:http://www.cnblogs.com/yaoshan/archive/2013/01/10/2854281.html

  • 相关阅读:
    Ansible批量更新远程主机用户密码
    国外程序员推荐:每个程序员都应该读的非编程书
    FindFriendsServer服务搭建
    Android JNI HelloWorld实现
    2014年4月读书单
    jQuery 之父:每天写代码
    QT210 Android4.0源码编译和烧录文档整理
    Android系统分区理解及分区目录细解
    Android组件Spinner使用
    使用事件驱动模型实现高效稳定的网络服务器程序
  • 原文地址:https://www.cnblogs.com/lmei/p/3450407.html
Copyright © 2011-2022 走看看