分批次获取git for windows的源代码

一共需要五步

第一步


$ git init
Initialized empty Git repository in d:/SourceCode/GitHub/Git For Windows/Git/.gi
t/

 

第二步


$ git remote add origin https://github.com/git-for-windows/git.git

 

第三步


$ git ls-remote origin >origin.txt

使用git ls-remote -t > origin.txt   增加-t参数,比较方便识别

git ls-remote --tags github >origin.txt

得到服务器上的Tag,自己根据需要去fetch想要的Tag

 

第四步


$ git fetch origin v1.6.1-msysgit1
remote: Counting objects: 73079, done.
remote: Compressing objects: 100% (330/330), done.
remote: Total 73079 (delta 4816), reused 4631 (delta 4631), pack-reused 68118
Receiving objects: 100% (73079/73079), 17.14 MiB | 1.14 MiB/s, done.
Resolving deltas: 100% (51999/51999), done.
From https://github.com/git-for-windows/git
* tag v1.6.1-msysgit1 -> FETCH_HEAD


$ git fetch origin v1.9.4.msysgit.1
remote: Counting objects: 193080, done.
remote: Total 193080 (delta 0), reused 0 (delta 0), pack-reused 193080
Receiving objects: 100% (193080/193080), 54.03 MiB | 609.00 KiB/s, done.
Resolving deltas: 100% (142069/142069), done.
From https://github.com/git-for-windows/git
* tag v1.9.4.msysgit.1 -> FETCH_HEAD

 

$ git fetch origin v2.3.4
remote: Counting objects: 175370, done.
remote: Total 175370 (delta 0), reused 0 (delta 0), pack-reused 175370
Receiving objects: 100% (175370/175370), 56.04 MiB | 92.00 KiB/s, done.
Resolving deltas: 100% (128917/128917), done.
From https://github.com/git-for-windows/git
* tag v2.3.4 -> FETCH_HEAD

 

Administrator@LUJUNTAO /d/SourceCode/GitHub/Git For Windows/Git (master)
$ git fetch origin v2.6.3
remote: Counting objects: 10069, done.
remote: Total 10069 (delta 3901), reused 3901 (delta 3901), pack-reused 6168R
Receiving objects: 100% (10069/10069), 7.16 MiB | 490.00 KiB/s, done.
Resolving deltas: 100% (7629/7629), completed with 1063 local objects.
From https://github.com/git-for-windows/git
* tag v2.6.3 -> FETCH_HEAD

 

$ git fetch origin master
remote: Counting objects: 44173, done.
remote: Total 44173 (delta 10724), reused 10724 (delta 10724), pack-reused 33449

Receiving objects: 100% (44173/44173), 12.66 MiB | 319.00 KiB/s, done.
Resolving deltas: 100% (31540/31540), completed with 747 local objects.
From https://github.com/git-for-windows/git
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master

 

$ git checkout master
Checking out files: 100% (739/739), done.
Previous HEAD position was af40944... Git 2.6.3
Switched to branch 'master'

 

第五步

同步所有的tag

$ git fetch --all  或者使用git fetch origin

Fetching origin
remote: Counting objects: 504, done.
Receiving objects: 70% (353/504), 92.00 KiB | 172.00 KiBremote: Total 504 (delt
a 235), reused 235 (delta 235), pack-reused 269
Receiving objects: 100% (504/504), 164.33 KiB | 172.00 KiB/s, done.
Resolving deltas: 100% (247/247), completed with 24 local objects.
From https://github.com/git-for-windows/git
* [new branch] maint-1.9 -> origin/maint-1.9
* [new tag] mingw-v1.5.2.4 -> mingw-v1.5.2.4
* [new tag] v1.6.1-msysgit1 -> v1.6.1-msysgit1
* [new tag] v1.6.1.msysgit.0 -> v1.6.1.msysgit.0
* [new tag] v1.6.2.1.msysgit.0 -> v1.6.2.1.msysgit.0
* [new tag] v1.6.2.2.msysgit.0 -> v1.6.2.2.msysgit.0
* [new tag] v1.6.2.msysgit.0 -> v1.6.2.msysgit.0
* [new tag] v1.6.3.2.msysgit.0 -> v1.6.3.2.msysgit.0
* [new tag] v1.6.3.msysgit.0 -> v1.6.3.msysgit.0
* [new tag] v1.6.4.msysgit.0 -> v1.6.4.msysgit.0
* [new tag] v1.6.5.1.msysgit.0 -> v1.6.5.1.msysgit.0
* [new tag] v1.7.0.2.msysgit.0 -> v1.7.0.2.msysgit.0
* [new tag] v1.7.1.msysgit.0 -> v1.7.1.msysgit.0
* [new tag] v1.7.10.msysgit.0 -> v1.7.10.msysgit.0
* [new tag] v1.7.10.msysgit.1 -> v1.7.10.msysgit.1
* [new tag] v1.7.11.msysgit.0 -> v1.7.11.msysgit.0
* [new tag] v1.7.11.msysgit.1 -> v1.7.11.msysgit.1
* [new tag] v1.7.2.3.msysgit.0 -> v1.7.2.3.msysgit.0
* [new tag] v1.7.3.1.msysgit.0 -> v1.7.3.1.msysgit.0
* [new tag] v1.7.3.2.msysgit.0 -> v1.7.3.2.msysgit.0
* [new tag] v1.7.4.msysgit.0 -> v1.7.4.msysgit.0
* [new tag] v1.7.6.msysgit.0 -> v1.7.6.msysgit.0
* [new tag] v1.7.7.1.msysgit.0 -> v1.7.7.1.msysgit.0
* [new tag] v1.7.7.msysgit.0 -> v1.7.7.msysgit.0
* [new tag] v1.7.7.msysgit.1 -> v1.7.7.msysgit.1
* [new tag] v1.7.8.msysgit.0 -> v1.7.8.msysgit.0
* [new tag] v1.7.9.msysgit.0 -> v1.7.9.msysgit.0
* [new tag] v1.8.0.msysgit.0 -> v1.8.0.msysgit.0
* [new tag] v1.8.1.msysgit.1 -> v1.8.1.msysgit.1
* [new tag] v1.8.3.msysgit.0 -> v1.8.3.msysgit.0
* [new tag] v1.8.4.msysgit.0 -> v1.8.4.msysgit.0
* [new tag] v1.8.5 -> v1.8.5
* [new tag] v1.8.5.1 -> v1.8.5.1
* [new tag] v1.8.5.2 -> v1.8.5.2
* [new tag] v1.8.5.2.msysgit.0 -> v1.8.5.2.msysgit.0
* [new tag] v1.9.0.msysgit.0 -> v1.9.0.msysgit.0
* [new tag] v1.9.2.msysgit.0 -> v1.9.2.msysgit.0
* [new tag] v1.9.4.msysgit.0 -> v1.9.4.msysgit.0
* [new tag] v1.9.4.msysgit.1 -> v1.9.4.msysgit.1
* [new tag] v2.1.2-mingw-1 -> v2.1.2-mingw-1
* [new tag] v2.3.0 -> v2.3.0
* [new tag] v2.3.0.windows.1 -> v2.3.0.windows.1
* [new tag] v2.3.1 -> v2.3.1
* [new tag] v2.3.1.windows.1 -> v2.3.1.windows.1
* [new tag] v2.3.3 -> v2.3.3
* [new tag] v2.3.3.windows.1 -> v2.3.3.windows.1
* [new tag] v2.3.4 -> v2.3.4
* [new tag] v2.3.4.windows.1 -> v2.3.4.windows.1
* [new tag] v2.3.4.windows.2 -> v2.3.4.windows.2
* [new tag] v2.3.4.windows.3 -> v2.3.4.windows.3
* [new tag] v2.3.5 -> v2.3.5
* [new tag] v2.3.5.windows.1 -> v2.3.5.windows.1
* [new tag] v2.3.5.windows.2 -> v2.3.5.windows.2
* [new tag] v2.3.5.windows.3 -> v2.3.5.windows.3
* [new tag] v2.3.5.windows.4 -> v2.3.5.windows.4
* [new tag] v2.3.5.windows.5 -> v2.3.5.windows.5
* [new tag] v2.3.5.windows.6 -> v2.3.5.windows.6
* [new tag] v2.3.5.windows.7 -> v2.3.5.windows.7
* [new tag] v2.3.5.windows.8 -> v2.3.5.windows.8
* [new tag] v2.3.6.windows.1 -> v2.3.6.windows.1
* [new tag] v2.3.6.windows.2 -> v2.3.6.windows.2
* [new tag] v2.3.7 -> v2.3.7
* [new tag] v2.3.7.windows.1 -> v2.3.7.windows.1
* [new tag] v2.4.0 -> v2.4.0
* [new tag] v2.4.0.windows.1 -> v2.4.0.windows.1
* [new tag] v2.4.0.windows.2 -> v2.4.0.windows.2
* [new tag] v2.4.1 -> v2.4.1
* [new tag] v2.4.1.windows.1 -> v2.4.1.windows.1
* [new tag] v2.4.2 -> v2.4.2
* [new tag] v2.4.2.windows.1 -> v2.4.2.windows.1
* [new tag] v2.4.3 -> v2.4.3
* [new tag] v2.4.3.windows.1 -> v2.4.3.windows.1
* [new tag] v2.4.4 -> v2.4.4
* [new tag] v2.4.4.windows.1 -> v2.4.4.windows.1
* [new tag] v2.4.4.windows.2 -> v2.4.4.windows.2
* [new tag] v2.4.5 -> v2.4.5
* [new tag] v2.4.5.windows.1 -> v2.4.5.windows.1
* [new tag] v2.4.6 -> v2.4.6
* [new tag] v2.4.6.windows.1 -> v2.4.6.windows.1
* [new tag] v2.4.7 -> v2.4.7
* [new tag] v2.5.0 -> v2.5.0
* [new tag] v2.5.0.windows.1 -> v2.5.0.windows.1
* [new tag] v2.5.1.windows.1 -> v2.5.1.windows.1
* [new tag] v2.5.2 -> v2.5.2
* [new tag] v2.5.2.windows.1 -> v2.5.2.windows.1
* [new tag] v2.5.2.windows.2 -> v2.5.2.windows.2
* [new tag] v2.5.3 -> v2.5.3
* [new tag] v2.5.3.windows.1 -> v2.5.3.windows.1
* [new tag] v2.6.0 -> v2.6.0
* [new tag] v2.6.0.windows.1 -> v2.6.0.windows.1
* [new tag] v2.6.1.windows.1 -> v2.6.1.windows.1
* [new tag] v2.6.2 -> v2.6.2
* [new tag] v2.6.2.windows.1 -> v2.6.2.windows.1
* [new tag] v2.6.3.windows.1 -> v2.6.3.windows.1

 

git branch -u origin/master

 

git pull -v

posted @ 2015-11-17 14:43  ChuckLu  阅读(897)  评论(0编辑  收藏  举报