如何找出 git clone 命令的原始 repository

下次自动登录
现在的位置:
& 综合 & 正文
Git_Clone a remote git repository and cd into it
First, clone a remote git repository and cd into it:
$ git clone git:///myproject
$ cd myproject
Next, look at the local branches in your repository:
$ git branch
But there are other branches hiding in your repository! You can see these using the
$ git branch -a
origin/HEAD
origin/master
origin/v1.0-stable
origin/experimental
If you just want to take a quick peek at an upstream branch, you can check it out directly:
$ git checkout origin/experimental
But if you want to work on that branch, you'll need to create a local tracking branch:
$ git checkout -b experimental origin/experimental
Now, if you look at your local branches, this is what you'll see:
$ git branch
* experimental
You can actually track more than one remote repository using git remote.
$ git remote add win32 git:///users/joe/myproject-win32-port
$ git branch -a
origin/HEAD
origin/master
origin/v1.0-stable
origin/experimental
win32/master
win32/new-widgets
At this point, things are getting pretty crazy, so run gitk to see what's going on:
$ gitk --all &
&&&&推荐文章:
【上篇】【下篇】2059人阅读
杂项(83)
最近遇到项目所使用的repository太大的情况,这种情况下如果要clone应该怎么做呢?
网上找了一圈,各种说法都有,我试了一下发现最好使的办法如下
git clone -depth 1 url
git fetch --depth 2
git fetch --depth 3 #注意这里可以是任意大的数字,只要你的buffer允许
git pull即可
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:627514次
积分:8329
积分:8329
排名:第2418名
原创:218篇
转载:15篇
译文:11篇
评论:133条
(1)(1)(1)(1)(1)(1)(2)(2)(3)(3)(1)(2)(4)(1)(4)(1)(1)(2)(3)(4)(2)(2)(5)(3)(4)(2)(3)(1)(4)(4)(7)(2)(2)(9)(6)(6)(1)(5)(3)(5)(2)(5)(7)(3)(4)(9)(9)(3)(8)(20)(9)(11)(6)(10)(6)(2)(2)(4)(2)(7)如何找出 git clone 的原始 repository_IThao123 - IT行业第一站
如何找出 git clone 的原始 repository
转载至:/questions/4076239/finding-out-the-name-of-the-original-repository-you-cloned-from-in-git
有两种方式:
① 查看 .git/config 的内容:
[remote &origin&]
fetch = +refs/heads/*:refs/remotes/origin/*
url = server:gitRepo.git
② 使用 git remote -v 命令
CopyRight 2014-

我要回帖

更多关于 git clone 失败 的文章

 

随机推荐