文档章节

google code的git客户端提交使用

key4su
 key4su
发布于 2012/08/24 13:25
字数 637
阅读 233
收藏 2
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 useshttps 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/ usehttps://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

本文转载自:http://www.cnblogs.com/crazymod/archive/2011/12/21/2296319.html

key4su
粉丝 1
博文 16
码字总数 2694
作品 0
珠海
程序员
私信 提问
如何导入外部Git仓库到中国源代码托管平台(Git@OSC)

针对最近有很多网友提问,如何导入外部代码仓库(Github、bitbucket、Google Code等等)到Git@OSC ,给出如下解决方案: 方案1: 从原始地址clone一份bare仓库 在Git@OSC上创建一个项目(htt...

王振威
2013/11/18
122.8K
60
Git:导入外部仓库至托管平台

针对最近有很多网友提问,如何导入外部代码仓库(Github、bitbucket、Google Code等等)到Git@OSC ,给出如下解决方案: 方案一: git clone --bare https://github.com/bartaz/impress.js....

滕先生
2018/06/27
0
0
Git提交代码push的时候报错常见错误

今天我想rk的sdk包里面的一些东西提交到我的git服务器上,结果,总是报错,折腾了一下午,结果才解决。 首先看看我提交代码的时候,报错的信息: git.exe push --progress "origin" master:...

神勇小白鼠
2018/11/08
573
0
Git 界面GUI和命令行Command两种操作方式

Git 进行代码版本管理时,有两种操作方式:图形界面GUI和 命令行Command 图形界面GUI:有平台限制,目前仅支持Windows系统,Linux(Unix)都是命令行模式,并且图形界面每次提交好像Display...

sunboy2050
2012/05/01
17.1K
0
g4e常见问题#2 修改 gitconfig 和常用配置

gitconfig 文件可以帮助我们对很多常用的git行为进行配置,让你自己的git环境更加适合你自己的偏好。 gitconfig的三级配置系统 我们在某个git仓库中看到的.gitignore和.gitattributes都属于G...

leixu
2018/01/07
0
0

没有更多内容

加载失败,请刷新页面

加载更多

spring源码分析6: ApplicationContext的初始化与BeanDefinition的搜集入库

先前几篇都是概念的讲解:回顾下 BeanDefinition 是物料 Bean是成品 BeanFactory是仓库,存储物料与成品 ApplicationContext初始化搜集物料入库,触发生产线,取出物料生产Bean 本文研究spr...

星星之焱
29分钟前
5
0
彻底解决tomcat乱码问题

本地项目请求访问,浏览器中文输出没问题。 部署到服务器上面之后,返回到浏览器的中文就乱码了。 尝试办法: 1.修改tomcat下的conf中的service.xml中的配置信息: 重新启动后,没有效果还是...

诗书易经
45分钟前
5
0
Java开发需要掌握的IDEA插件大全

1、Lombok 解释:这是最基本的插件,2017年就火了,还没用的百度一下吧。 博客链接:Intellij IDEA 安装lombok及使用详解 2、PlantUML integration 解释:各种类之间的关联图,高级开发必备。...

木九天
46分钟前
6
0
python学习10.05:Python range()快速初始化数字列表

实际场景中,经常需要存储一组数字。例如在游戏中,需要跟踪每个角色的位置,还可能需要跟踪玩家的几个最高得分。在数据可视化中,处理的几乎都是由数字(如温度、距离、人口数量、经度和纬度...

太空堡垒185
53分钟前
4
0
java单元测试,PowerMockito模拟方法内new对象

在做单元测试中有时候需要对方法内new出来的对象进行隔离,这是我们需要使用PowerMockito。 添加依赖 <dependency> <groupId>org.powermock</groupId> <artifactId>......

如梦之猿
55分钟前
5
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部