首页
登录 | 注册

google code的git客户端提交使用

Since Google Code has started to support Git, I wanted to take the opportunity to reboot the ObjectivEClipse project to consume the Eclipse CDT mirror on GitHub so that I could keep up to date with the main mirror whilst adding support for Objective-C. This post shows you how you can migrate your existing Google Code repositories to Git.

Firstly, you'll need your account details from https://code.google.com/hosting/settings. Since Google Code uses https instead of ssh for its code pushes, we need to know what the password is to use.

For security reasons, I recommend against using your Google Account password. Although it's possible to configure, in essence the password is transmitted in plain text, albeit over an https connection. But if this password gets out, you've lost control to all of your Google Account estate.

Instead, Google Code shows you your GoogleCode password when you visit the URL above:

alex.blewitt@example.com's googlecode.com password: Tm90TXlQVyEK

We can use this password to authenticate instead, and if it gets let out accidentally, like Doctor Who, we can click on the "Regenerate" button and get a new one.

Ordinarily, we wouldn't want to have to remember this each time we use clients. You might be using a GUI tool (like EGit*) which remembers the password for you, but if you want to do things on the command line then using SSH keys to login are widely known but not applicable forhttps connections.

Instead, we can put the entries in the ~/.netrc file (on Unixes, at least) which will be used for the interop with the server. We can configure it like so:

echo machine code.google.com >> ~/.netrc echo login alex.blewitt@example.com >> ~/.netrc echo password Tm90TXlQVyEK >> ~/.netrc chmod go= ~/.netrc

Note that this applies only to machine connections going to code.google.com, but you might want to configure it for your project's name directly:

echo machine project.googlecode.com >> ~/.netrc echo login alex.blewitt@example.com >> ~/.netrc echo password Tm90TXlQVyEK >> ~/.netrc echo machine wiki.project.googlecode.com >> ~/.netrc echo login alex.blewitt@example.com >> ~/.netrc echo password Tm90TXlQVyEK >> ~/.netrc

Note that the project's wiki is in a different location than the main code for Git and Hg repositories (in SVN, it's part of the same repository as the code).

As an alternative, you can access using the code.google.com host for both the project and the wiki – just suffix the project name with .wikiinstead, e.g. for https://code.google.com/p/objectiveclipse/ use https://code.google.com/p/objectiveclipse.wiki/

Note that when you convert your project over from SVN to Git, it will appear that the Wiki content gets deleted. That's because the Wiki server starts serving content from your new Wiki location, which won't be populated with the old content.

Fortunately, migrating the wiki content is easy enough. You can access it via the old SVN site you have, which though it's not visible via the main project's URL, is visible via the direct project repository site:

$ git clone https://wiki.project.googlecode.com/git projectWiki $ svn checkout http://project.googlecode.com/svn/wiki wiki $ cp wiki/*.wiki projectWiki $ cd projectWiki $ git add . $ git commit -a -m "Imported from old SVN wiki" $ git push

You now have your wiki pushed to the repository. Of course, if you wanted to maintain history, then you could instead do a git svn cloneinstead.

Migrating the main repository (from GitHub to GoogleCode) should be as simple as adding a new remote, and hitting push:

$ cd /path/to/existing/github/clone $ git remote add googlecode https://project.googlecode.com/git $ git push googlecode master:master

Congratulations, you are now using Google Code in conjunction with Git.

* Note to EGit users: there's currently a bug which prevents EGit from using Google Code since the latter reports an invalid value.

注: windows下~/.netrc应改为 ~/_netrc


相关文章

  • 最近公司项目需要用到Git来管理项目,正好逢周末花了点时间在虚拟机的unbuntu系统中搭建了下git的服务器,由于搭建过程中多多少少遇到了一些小问题,再因为个人记性不太好,所以在这里记录下来,以备不时之需. 参考:blog.csdn.ne ...
  • libcurl curl是Linux下一个非常著名的下载库,通过这个库,可以很简单的实现文件的下载等操作. 看一个简单的例子: #include <curl/curl.h> #include <stdio.h> #i ...
  • 要在Java中使用 memcached ,先要安装memcached 服务端(见:http://blog.chinaunix.net/u2/73798/showart.php?id=2263251).   先去 http://github. ...
  • Presto入门介绍
    Presto基本认识 查询引擎 和大家熟悉的Mysql相比:首先Mysql是一个数据库,具有存储和计算分析能力,而Presto只有计算分析能力:其次数据量方面,Mysql作为传统单点关系型数据库不能满足当前大数据量的需求,于是有各种大数据的 ...
  • 微信公众号中看到的一篇文章,挺全的,想要走架构师这条路的程序员可以作为参考学习计划,个人感觉深度有余,广度不足. Java架构师主要需要做哪些工作呢? 1.负责设计和搭建软件系统架构(平台.数据库.接口和应用架构等),解决开发中各种系统架构 ...
  • 使用Gitolite搭建轻量级的Git服务器-a
    使用Gitolite搭建轻量级的Git服务器 By Harrison Feng 在Git服务管理工具这个领域,主要有三种流行的方案,它们分别是 Gitosis - 轻量级, 开源项目,使用SSH公钥认证,只能做到库级的权限控制.目前项目已经 ...

2020 unjeep.com webmaster#unjeep.com
12 q. 0.013 s.
京ICP备10005923号