如何推动本地Git回购到新创建的Google Code项目? [英] How to push local Git repo to newly created Google Code project?

查看:113
本文介绍了如何推动本地Git回购到新创建的Google Code项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在新建项目向导中,我有一个由Qt Creator创建的本地git仓库。我在那里做了很多提交。我现在只创建了一个新的Google Code项目。什么是最好的方式来同步远程repo到我的本地?

解决方案

你可以在本文使用Git设置Google代码来自 AlBlue的博客

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

请参阅 git remote 命令:如果您有一个现有的远程(谷歌代码)回购准备就绪,您可以将其地址添加到本地回购并开始推送(假设您正确地设置了文章中描述的〜/ .netrc 文件,或者您的%HOME%\_netrc windows的文件:参见 Git - 如何使用 .netrc 在windows上保存用户和密码的文件)。



完成本地提交后,您可以推送 master 分支(参见),然后从那里获得 git push googlecode

如果调用远程' origin ',那么在第一次推送后,您将可以执行' git push '为未来推动。

I have a local git repo created by Qt Creator during the New Project Wizard. I've made many commits there. I have created a new Google Code project only now. What is the best way to sync the remote repo to my local one?

You can see an example at this article "Setting up Google Code with Git" from AlBlue’s Blog:

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

See git remote command: if you have an existing remote (google code) repo ready, you can add its address to your local repo and start pushing (provided you did setup correctly your ~/.netrc file as described in the article, or your %HOME%\_netrc file for windows: see "Git - How to use .netrc file on windows to save user and password" for more).

Once you have done a local commit, you can push the master branch (see "Push origin master error on new repository"), and from there just git push googlecode.
If your remote is called 'origin', then after the first push, you will be able to just do 'git push' for the future pushes.

这篇关于如何推动本地Git回购到新创建的Google Code项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆