Git/Gitorious使用方法小记

1 篇文章 0 订阅

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有用链接



  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值