日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

git clone 一些简单笔记

發布時間:2025/3/21 编程问答 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 git clone 一些简单笔记 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

自使用了git后,就徹底喜歡上了,深深體會到了自由的感覺,記錄一些簡單的筆記和使用心得,僅供留跡,以備后查。。。

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

參數挺多,但常用的就幾個:

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?顯示所有分支,如:    

* masterremotes/origin/HEAD -> origin/masterremotes/origin/devremotes/origin/master

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

git checkout -t origin/dev 該命令等同于:
git checkout -b dev origin/dev from: http://www.cnblogs.com/yaoshan/archive/2013/01/10/2854281.html

總結

以上是生活随笔為你收集整理的git clone 一些简单笔记的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。