Setting Up Google Code And Github With Git
2012-12-12 18:41
423 查看
建立google code 与github的git 版本控制的代码库
先下载并安装好git
github与google code都有git下载
github:https://help.github.com/articles/set-up-git
googlecode:http://code.google.com/p/msysgit/downloads/list
#对提交设置默认的名字
$ git config --global user.name "Your Name Here"
#设置全局($HOME/.gitconfig)的email信息
$ git config --global user.email "your_email@youremail.com"
-------------------------
github
1.检查当前用户目录下有.ssh文件夹;
2.如果有.ssh文件夹,就删除(并备份)原来的shh key(包括私钥与公钥以id_rsa*打头的文件);
3.在用户当前目录下生成新的ssh key,使用以下命令:
$ ssh-keygen -t rsa -C "your_email@youremail.com"
//指定生成的key的保存目录
Enter file in which to save the key (/c/Users/you/.ssh/id_rsa): [回车]
//输入密码与重复密码
Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]
4.将刚生成的公钥文件中的内容复制到剪粘板,再登录github "Add SSH Key"
5.完成后使用ssh测试连接github:ssh -T git@github.com
--------------------------
google code
1.首先在google code上建立一个git project,clone下来;
2.在当前用户目录下使用cmd创建一个.netrc的文件,使用命令:
~> edit .netrc
并添加以下内容,${}中间以自己的用户名与googlecode密码替换:
machine code.google.com login ${username}@gmail.com password ${googlecode_password}
其格式如下:
machine <hostname1>
login <login1>
password <password1>
machine <hostname2>
login <login2>
password <password2>
3.设置HOME环境变量(windows)
cmd命令: setx HOME %USERPROFILE% 或
@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
@if not exist "%HOME%" @set HOME=%USERPROFILE%
4.设置clone的project的remote "origin"的url为: https://code.google.com/p/some-project/ git bash进入some-project的根目录,使用命令:
git remote set-url origin https://code.google.com/p/some-project/ 或修改some-project/.git/config文件中的
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://bob@code.google.com/p/some-project/ 为
remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://code.google.com/p/some-project/
好了,这样修改之后就可以向google code push 了,也可以向github push 了...
先下载并安装好git
github与google code都有git下载
github:https://help.github.com/articles/set-up-git
googlecode:http://code.google.com/p/msysgit/downloads/list
#对提交设置默认的名字
$ git config --global user.name "Your Name Here"
#设置全局($HOME/.gitconfig)的email信息
$ git config --global user.email "your_email@youremail.com"
-------------------------
github
1.检查当前用户目录下有.ssh文件夹;
2.如果有.ssh文件夹,就删除(并备份)原来的shh key(包括私钥与公钥以id_rsa*打头的文件);
3.在用户当前目录下生成新的ssh key,使用以下命令:
$ ssh-keygen -t rsa -C "your_email@youremail.com"
//指定生成的key的保存目录
Enter file in which to save the key (/c/Users/you/.ssh/id_rsa): [回车]
//输入密码与重复密码
Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]
4.将刚生成的公钥文件中的内容复制到剪粘板,再登录github "Add SSH Key"
5.完成后使用ssh测试连接github:ssh -T git@github.com
--------------------------
google code
1.首先在google code上建立一个git project,clone下来;
2.在当前用户目录下使用cmd创建一个.netrc的文件,使用命令:
~> edit .netrc
并添加以下内容,${}中间以自己的用户名与googlecode密码替换:
machine code.google.com login ${username}@gmail.com password ${googlecode_password}
其格式如下:
machine <hostname1>
login <login1>
password <password1>
machine <hostname2>
login <login2>
password <password2>
3.设置HOME环境变量(windows)
cmd命令: setx HOME %USERPROFILE% 或
@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
@if not exist "%HOME%" @set HOME=%USERPROFILE%
4.设置clone的project的remote "origin"的url为: https://code.google.com/p/some-project/ git bash进入some-project的根目录,使用命令:
git remote set-url origin https://code.google.com/p/some-project/ 或修改some-project/.git/config文件中的
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://bob@code.google.com/p/some-project/ 为
remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://code.google.com/p/some-project/
好了,这样修改之后就可以向google code push 了,也可以向github push 了...
相关文章推荐
- 【NLP新闻-2013.05.15】How Google is setting the new search standard with voice and knowledge graph
- Setting up SSL for SCM-Manager with Microsoft CA and TortoiseHg
- 17.1.1.7 Setting Up Replication with New Master and Slaves 设置复制对于新的Master和Slaves:
- Setting up Django with Nginx, Gunicorn, virtualenv, supervisor and PostgreSQL
- Setting up Mosquitto 1.4 with libwebsockets on CentOS 7 on Google Compute Engine
- 17.1.1.7 Setting Up Replication with New Master and Slaves 设置复制对于新的Master和Slaves:
- Setting up Django and your web server with uWSGI and nginx
- Setting up Django and your web server with uWSGI and nginx
- 17.1.1.7 Setting Up Replication with New Master and Slaves
- 17.1.1.7 Setting Up Replication with New Master and Slaves 设置复制对于新的Master和Slaves:
- Setting up Django and your web server with uWSGI and nginx
- Setting up Django and your web server with uWSGI and nginx
- Setting up a PHP 5 with Apache 2 and MySQL 4.1.3
- Setting Up Transmission-Daemon To Use With Remote GUI In Ubuntu And Debian
- 17.1.1.7 Setting Up Replication with New Master and Slaves 设置复制使用新的master和slaves:
- Setting up Django and your web server with uWSGI and nginx
- 17.1.1.7 Setting Up Replication with New Master and Slaves 设置复制使用新的master和slaves:
- Setting Up OpenERP (Odoo) 9 with Nginx on RHEL/CentOS and Debian/Ubuntu
- Setting up Django and your web server with uWSGI and nginx
- Continuous Code Coverage with gcc, googletest, and Hudson