git断点续传

git断点续传

Git clone不行,

用git init

git fetch git://…..git

即使断掉了,可以继续

git fetch git://…..git

等到fetch完会出现以下字样

From git://….

*branch           HEAD                -> FETCH_HEAD

意思是把最新的数据fetch到了本地的FETCH_HEAD分支上去了

然后用git checkout FETCH_HEAD

或者也等同于git fetch git://…..git HEAD:FETCH_HEAD(没测试)


例如:

(1): git fetch git://repo.or.cz/tomato.git

如果中途掉线,继续执行上面(1)命令

(2): git checkout FETCH_HEAD 或者git fetch git://repo.or.cz/tomato.git HEAD



异曲同工之妙

1. git clone git://android.git.kernel.org/ + project path.

2. mkdir mydroid

   cd mydroid
   repo init -u git://android.git.kernel.org/platform/manifest.git
   repo sync

 

git clone获取比较大的源码时, 不能断点续传, 比较恼火.

 

可以使用 git fetch 解决:

     mkdir common

     cd common

     git init

     git fetch http://android.git.kernel.org/common.git

     传完后,

     git branch -a

     git checkout remotes/....

如果中间断掉了, 可以直接进入common目录, 继续git fetch就可以续传了.


你可能感兴趣的:(编程工具)