之后如何获取完整的git历史记录“ git clone --depth = 1”?

我的一个git repo很大,其中包含以前提交的大量资产。

以某种方式,我能够使用@Configuration public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdapter { @Override public void configure(final AuthorizationServerEndpointsConfigurer endpoints) throws Exception { endpoints // ... .tokenServices(tokenServices(endpoints)); } public AuthorizationServerTokenServices tokenServices(final AuthorizationServerEndpointsConfigurer endpoints) { final DefaultTokenServices tokenServices = new DefaultTokenServices(); tokenServices.setTokenStore(endpoints.getTokenStore()); tokenServices.setClientDetailsService(endpoints.getclientDetailsService()); tokenServices.setTokenEnhancer(endpoints.getTokenEnhancer()); // ... tokenServices.setauthenticationmanager( new ProviderManager(List.of(new MyCustomAuthProvider()))); return tokenServices; } } 克隆repo(使其成为可运行的)。

我想在同一本地存储库上获得所有先前的提交。

谢谢。

nathansgl 回答:之后如何获取完整的git历史记录“ git clone --depth = 1”?

git pull --unshallow应该这样做。

发件人({git-scm

  

--unshallow

     

如果源存储库已完成,请将浅存储库转换为完整存储库,从而消除浅存储库带来的所有限制。

     

如果源存储库较浅,请尽可能多地获取,以使当前存储库与源存储库具有相同的历史记录。

pull的{​​{1}},--depth--deepen=也可能是相关的。

发件人({git-scm

  

--shallow-since

     

将限制从每个远程分支历史记录的顶端提取到指定的提交数量。如果使用--depth =选项(请参见git-clone [1])提取到git clone创建的浅层存储库,请加深历史记录或将其缩短到指定的提交次数。无法获取用于深化提交的标记。

     

--depth=<depth>

     

类似于--deepen=<depth>,除了它指定从当前浅边界而不是从每个远程分支历史记录的尖端提交的提交次数。

     

--depth

     

加深或缩短浅存储库的历史记录,以包括--shallow-since=<date>之后的所有可到达的提交。


<date>大师@torek指出以下几点:

  

请注意,默认情况下,使用--depth创建的克隆也是单分支克隆。要使其成为完整的克隆,您将需要撤消此单个分支效果。

如何操作显示在How do I "undo" a --single-branch clone?

本文链接:https://www.f2er.com/3162282.html

大家都在问