该git clone --depth命令选项说
--depth <depth>
Create a shallow clone with a history truncated to the specified number of revisions.
A shallow repository has a number of limitations
(you cannot clone or fetch from it, nor push from nor into it),
but is adequate if you are only interested in the recent history of a large project with a long history,
and would want to send in fixes as patches.
Run Code Online (Sandbox Code Playgroud)
为什么浅克隆有这种限制?为什么它只是一个补丁工作流程?
对于某些项目工作流程,我需要将最新的提交从单个分支传递给编码器,然后让它们能够push(快进)开发到主服务器.这部分是为了安全,知识产权保护和回购规模,部分是为了减少大回购会给天真编码员带来的困惑.是否有允许这样的git工作流程?
更新:根据Karl Bielefeldt的回答,git checkout --orphan …
我想知道是否有任何方法可以知道谁已经检查了我在GitHub上托管的项目?这将包括直接在GitHub上分叉项目的人员,以及可能使用标准git clone命令克隆存储库的人员.
我正在开始使用git repo与svn repo进行交互.svn存储库设置正常,只需提交一个基本的README文件.
检查出来工作正常:
tchalvak:~/test/svn-test$
svn checkout --username=myUsernameHere http://www.url.to/project/here/charityweb/
A charityweb/README
Checked out revision 1.
Run Code Online (Sandbox Code Playgroud)
当我尝试在git中克隆存储库时,第一步显示没有错误...
tchalvak:~/test$
git svn clone -s --username=myUserNameHere http://www.url.to/project/here/charityweb/
Initialized empty Git repository in /home/tchalvak/test/charityweb/.git/
Authentication realm: <http://www.url.to/project/here:80> Charity Web
Password for 'myUserNameHere':
Run Code Online (Sandbox Code Playgroud)
...但是导致无用的文件夹,不包含文件,没有分支,也没有提交:
tchalvak:~/test$ ls
charityweb
tchalvak:~/test$ cd charityweb/
tchalvak:~/test/charityweb$ ls
tchalvak:~/test/charityweb$ ls -al
total 12
drwxr-xr-x 3 tchalvak tchalvak 4096 2010-04-02 13:46 .
drwxr-xr-x 4 tchalvak tchalvak 4096 2010-04-02 13:46 ..
drwxr-xr-x 8 tchalvak tchalvak 4096 2010-04-02 13:47 .git
tchalvak:~/test/charityweb$ git …Run Code Online (Sandbox Code Playgroud) 有没有办法暂停git clone并在以后恢复?我正在克隆一个非常大的回购(大约2GB),我的PC已经打开超过40个小时.我有学校要赶上,我不想这样离开.有人有个主意吗?它的价格已经达到了67%.:(
当我克隆存储库时,这两个URL之间有什么区别吗?
没有.git扩展名:
git clone http://foo/repo
Run Code Online (Sandbox Code Playgroud)扩展名为.git:
git clone http://foo/repo.git
Run Code Online (Sandbox Code Playgroud)视觉工作室停止将我的提交发送到bitbucket并出现此错误
克隆远程存储库时遇到错误:Git失败并出现致命错误.遇到HttpRequestException.提交请求时出错.无法产卵
C/Program Files(x86)/ Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/Git/mingw32/libexec/git-core/git-askpass.exe:没有这样的文件或目录
无法读取"https://gustavobedsamarpes@bitbucket.org"的密码:终端提示已禁用当我尝试克隆我的存储库或提交时发生错误
尝试克隆私有存储库我有权使用HTTPS协议,因为这只允许传出流量.
git没有要求密码,只是失败了.
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/blah/blahblah.git/info/refs
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
我正在尝试克隆github上的远程存储库,但它很大,我的连接似乎不够稳定,所以我无法成功克隆它.
但是我已经成功下载了存储库的.zip.
有没有办法使用这个由git clone创建的zip,所以我可以推,拉等...?
我的理解是克隆存储库的默认分支是HEAD指向克隆的repo中的任何内容.
我现在有一个案例,这不是真的.我的理解显然是有缺陷的,那么在克隆(裸)repo时,什么决定了默认的checkout分支呢?
该repo的最后一次提交是在裸仓库的HEAD中引用的分支与我在克隆中作为checkout分支获得的分支之间的合并.
运行git remote show origin回报:
Fetch URL: ...
Push URL: ...
HEAD branch (remote HEAD is ambiguous, may be one of the following):
<bad-branch>
live
Remote branches:
...
Run Code Online (Sandbox Code Playgroud)
Bare repo使用Git版本1.8.2.1,客户端使用1.7.12.4,传输是SSH.
也许答案实际上是这里的答案.这个答案证实了这一点.如果选择的符号引用都指向与HEAD相同的修订版,则客户端将猜测要使用哪个分支.
我觉得我很蠢.我不明白Git如何使用命令行,所以我使用的是Git Gui.
我安装了它并且Gui可以成功启动,但是当我从另一个程序员和我共享的文件中克隆文件时,我不断收到此错误消息,
位置C:/ ....已经存在.
在Gui界面上,它有两个输入字段只能填写 -
'Source Location' : https://me@github.com/remote-programmer/project-1.git (for instance)
'Target Directory' : C:/wamp/www/project-1-folder (for instance)
Run Code Online (Sandbox Code Playgroud)
任何可用的视觉指南,我可以避免命令行?
谢谢!