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
参数挺多,但常用的就几个:
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
git分享(一)git clone的更多相关文章
- 分享 | Git常用的一些命令
最近,各个项目团队已经全面从svn转向Git 近期将会分享一些Git的常用操作及使用经验: 先了解下工作中一些需要用到的命令: --------------------------- Git基本常用命 ...
- Androidstudio项目分享到Git@OSC托管
Androidstudio项目分享到Git@OSC托管. 一.在OSC创建仓库 例如,创建一个AndroidStudy仓库,创建步骤如下: 输入仓库名称 点击创建按钮,就可以完成仓库的创建,如下图所示 ...
- 使用EGit插件将Eclipse现有项目分享到git@osc
. . . . . 程序员一定要养成使用版本管理工具的好习惯,即使是自己一个人开发的项目也要加入到版本管理工具中.使用版本管理工具主要有两个好处:一个是更好的管理多个副本,这个优势不用说了:另一个就是 ...
- Git从码云Clone代码到本地
Git从码云或者Github 克隆代码到本地 1.下载安装Git,傻瓜式下一步下一步即可... 2.配置Git: 2.1.选择你要clone到本地的路径:右键--->$ Git Bash Her ...
- git命令之git clone用法
在使用git来进行版本控制时,为了得一个项目的拷贝(copy),我们需要知道这个项目仓库的地址(Git URL). Git能在许多协议下使用,所以Git URL可能以ssh://, http(s):/ ...
- Git 中 pull 和 clone 的区别
git pull git clone clone 是本地没有 repository 时,将远程 repository 整个下载过来. pull 是本地有 repository 时,将远程 reposi ...
- git get submodule after clone
/********************************************************************************* * git get submodu ...
- git第二节----git clone与git tag
@git 远程克隆(clone)仓库,将远程工程clone到本地仓库:默认克隆远程master 分支 git clone https://github.com/kaokaozhu/Test.git ...
- git clone、git pull和git fetch的用法及区别
声明:码字不易,转载请注明出处,欢迎文章下方讨论交流.Git 常用命令速查表 最近在一个学习小组里学习AI的课程,我们所有的学习资料和homework都放在gitlab上.今天一个小队友从gitlab ...
随机推荐
- 理解与模拟一个简单servlet容器
servlet接口 使用servlet编程需要实现或者继承实现了javax.servlet.Servlet接口的类,其中定义了5个签名方法: public void init(ServletConfi ...
- Objective-c中 isEqual ,isEqualToString , == 三者的区别
首先 OC中的对象都是用指针表示,方法的调用是基于消息机制实现,== 比较的自然是指针指向的地址 然后 说下 isEqual 和 isEqualToString 的区别 IsEqual 是 NSObj ...
- [苏飞开发助手V1.0测试版]官方教程与升级报告
[苏飞开发助手V1.0测试版]官方教程与升级报告导读部分----------------------------------------------------------------- ...
- SQL Server复制入门(一)----复制简介
简介 SQL Server中的复制(Replication)是SQL Server高可用性的核心功能之一,在我看来,复制指的并不仅仅是一项技术,而是一些列技术的集合,包括从存储转发数据到同步数据到维护 ...
- Android中使用自定义View实现下载进度的显示
一般有下载功能的应用都会有这样一个场景,需要一个图标来标识不同的状态.之前在公司的项目中写过一个,今天抽空来整理一下. 一般下载都会有这么几种状态:未开始.等待.正在下载.下载结束,当然有时候会有下载 ...
- 解决.Net 4.0 A potentially dangerous Request.Form value was detected from the client 异常
在web.config中加入 <httpRuntime maxRequestLength="22000" executionTimeout="43200" ...
- Find Minimum in Rotated Sorted Array leetcode java
题目: Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 ...
- Weblogic Session复制策略与方式
在Weblogic中,HttpSession Replication的方式是通过在weblogic.xml中的session- descriptor的定义persistent-store-type来实 ...
- Apex Design Patterns
Apex allows you to build just about any custom solution on the Force.com platform. But what are the ...
- 使用 dbms_xplan.display 按照 plan_hash_value 查执行计划的方法
dbms_xplan.display_* 能按照 plan_hash_value 只有 display_awr 方法,如果这个SQL PLAN 刚刚生成,没有写入到AWR怎么办呢? 可以将 V$SQL ...