2009年5月11日起,诺基亚Qt Software 宣布 Qt源代码库面向公众开放,Qt 开发人员可通过为 Qt 以及与 Qt 相关的项目贡献代码、翻译、示例以及其他内容,协助引导和塑造 Qt未来的发展。为了便于这些内容的管理,Qt Software 启用了基于 Git 和 Gitorious 开源项目的Web 源代码管理系统
首先,需要在https://gitorious.org在注册个人帐号,在Dashboard中配置自己的Profile,包括SSH key。
在Gitorious的Git server的配置完毕后,便可尝试创建自己的项目了。通过Gitorious web端的友好界面非常容易创建自己的项目,项目生成后或产生一个URL,Git支持多种协议,包括git, ssh以及http来实现项目内容web/local端的通信及其同步。
当一个新的项目在Gitorious中生成后,它会友情提示如下信息引导我们如何将本地的代码推送到Web端。
Configure Git
If you have not done so already, download and install Git
git config --global user.name "chang sheng"
git config --global user.email "changsheng230@gmail.com"
Pushing your local repository to Gitorious
@Line1@ git checkout master
@Line2@ git remote add origin git@gitorious.org:helloworldqt/learngit_david.git
@Line3@ git push origin master
这里我将重点讲解一下上面三行Git指令的含义:
@Line1@ : chekout 分支master
@Line2@: remote respository以URL:git@gitorious.org:helloworldqt/learngit_david.git表示
第二行的的意思是,将git@gitorious.org:helloworldqt/learngit_david.git 在本地简化称作origin
@Line3@: 将本地的Master分支内容Push到Remote端Origin,即git@gitorious.org:helloworldqt/learngit_david.git
其他的一些常用命令
1 Clone repo
git clone git@xxx
2 Track the remote branch
Git checkout –b your_local_branch_name origin/remote_branch_name
Note: after that,your_local_branch_name branch is checkout, i.e. the current using branch
3 Get the latestchanges in remote branch
Git pull
4 Coding and submit to your_local_branch_name branch
Git commit –a
5 Push to remote branch
Git push origin your_local_branch_name:your_remote_branch_name
附Git有用链接