Chinaunix首页 | 论坛 | 博客
  • 博客访问: 532683
  • 博文数量: 116
  • 博客积分: 2063
  • 博客等级: 大尉
  • 技术积分: 1174
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-26 16:44
个人简介

none

文章分类

全部博文(116)

文章存档

2023年(2)

2020年(3)

2019年(4)

2018年(7)

2017年(6)

2016年(17)

2015年(13)

2014年(19)

2013年(6)

2012年(13)

2011年(5)

2010年(11)

2008年(10)

分类: 服务器与存储

2012-01-17 16:00:06

前言:最近想把google/code上的代码改为git托管,但一直clone不出来,不管是http还是https都很难clone成功

git clone
Initialized empty Git repository in /home/wenjing/.svn189_dev01/src/software/driver/goojje/.git/
error: Couldn't resolve host 'code.google.com' while accessing /info/refs

fatal: HTTP request failed

猜想应该是GFW的原因,因为没找到怎么linux下shell翻墙的方法,只好在windows下翻墙后用windows版本的git测试[可从下载,我用的是Git-1.7.8-preview20111206.exe版本]
####################################################################################################

Welcome to Git (version 1.7.8-preview20111206)


Run 'git help git' to display the help index.
Run 'git help ' to display help for specific commands.

Administrator@WWW-A1FA49E1267 ~
$ ls
Application Data  My Documents  SendTo      _sam-ba.rc      ntuser.pol
Cookies           NTUSER.DAT    Start Menu  _viminfo
Desktop           NetHood       Templates   goojje
Favorites         PrintHood     UserData    ntuser.dat.LOG
Local Settings    Recent        WINDOWS     ntuser.ini

Administrator@WWW-A1FA49E1267 ~
$ git clone
Cloning into 'kewell0101'...
warning: You appear to have cloned an empty repository.

##################################################
# 取下来的整个仓库无任何数据,对第一次提交到远程仓库时使用的命令式有区别的
##################################################

Administrator@WWW-A1FA49E1267 ~
$ cd kewell0101/

Administrator@WWW-A1FA49E1267 ~/kewell0101 (master)
$ touch Readme

Administrator@WWW-A1FA49E1267 ~/kewell0101 (master)
$ git add Readme

Administrator@WWW-A1FA49E1267 ~/kewell0101 (master)
$ git commit -m "should be fake success"
[master (root-commit) b09aecc] should be fake success
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 Readme

Administrator@WWW-A1FA49E1267 ~/kewell0101 (master)
$ git push
Username for 'code.google.com':
Password for 'code.google.com':
Everything up-to-date

##################################################
# 因初始clone出来仓库时空的,这里push后看起来似乎没问题,但是远程服务器上没任何数据
##################################################

Administrator@WWW-A1FA49E1267 ~/kewell0101 (master)
$ git push origin master
Username for 'code.google.com':
Password for 'code.google.com':
Counting objects: 3, done.
Writing objects: 100% (3/3), 213 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Scanning pack: 100% (3/3), done.
remote: Storing objects: 100% (3/3), done.
remote: Processing commits: 100% (1/1), done.
To
 * [new branch]      master -> master

##################################################
# 'git push origin master' 后远程服务器上才有数据更新记录,且提交返回的结果也不一样
##################################################

Administrator@WWW-A1FA49E1267 ~/kewell0101 (master)
$ echo "some more change here" >> Readme

Administrator@WWW-A1FA49E1267 ~/kewell0101 (master)
$ git commit -a -m "added initial version of page cache"
[master ab08387] added initial version of page cache
 1 files changed, 1 insertions(+), 0 deletions(-)

Administrator@WWW-A1FA49E1267 ~/kewell0101 (master)
$ git push
Username for 'code.google.com':
Password for 'code.google.com':
Counting objects: 5, done.
Writing objects: 100% (3/3), 261 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Scanning pack: 100% (3/3), done.
remote: Storing objects: 100% (3/3), done.
remote: Processing commits: 100% (1/1), done.
To
   b09aecc..ab08387  master -> master

##################################################
# 再次提交打服务器时,因为远端仓库已经不为空,所以可以直接执行'git push'
##################################################

Administrator@WWW-A1FA49E1267 ~/kewell0101 (master)
$ git log
commit ab083877eb6a6986d818c69cb2b51dc58f80d3b3
Author: wenjing0101@gmail.com
Date:   Tue Jan 17 11:46:24 2012 +0800

    added initial version of page cache

commit b09aecce38f8f295fe43ca6d5cadeddd243bd471
Author: wenjing0101@gmail.com
Date:   Tue Jan 17 11:43:28 2012 +0800

    should be fake success

Administrator@WWW-A1FA49E1267 ~/kewell0101 (master)
$
阅读(1045) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~