git clone 一些简单笔记
生活随笔
收集整理的這篇文章主要介紹了
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.git2. 如果想clone到指定目錄
git clone xxx.git "指定目錄"3. clone時創建新的分支替代默認Origin HEAD(master)
git clone -b [new_branch_name] xxx.git4. clone 遠程分支
git clone 命令默認的只會建立master分支,如果你想clone指定的某一遠程分支(如:dev)的話,可以如下:
A. 查看所有分支(包括隱藏的) ?git branch -a?顯示所有分支,如:
* masterremotes/origin/HEAD -> origin/masterremotes/origin/devremotes/origin/masterB. ?在本地新建同名的("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 一些简单笔记的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Eclipse转Intellij IDE
- 下一篇: MVC 模式