Git使用经验

  1. 新建git项目步骤
  • 配置gitosis-admin:

          >git clone

          >vi  gitosis-admin/gitosis.conf

          [group pv_system]

          writable =pvinsight_app 

          members =username

          >git  commit   –am “add project pvinsight_app”

          >git push

  • 本地新建项目(已有git客户端环境):

          >mkdir  pvinsight_app

          >cd  pvinsight_app

          >git  init 

          >git  add  . (新增文件)

          >git  commit   –am “pvinsight_app init project”

          >git  remote  add  origin  

          >git  push origin master

          >……

 

      2.  检查哪些文件被更改


          git log
          ------------------------------------------------------
          commit eed0fba3a0f493a8f21997260e6bc6d7573f08bf
          Author: xxx <xxx@xxx.com>
          Date: Thu Aug 18 15:33:55 2011 +0800


          编号:eed0fba3a0f493a8f21997260e6bc6d7573f08bf
 
          包含有所有更改记录的文件列表
          git diff --name-only eed0fba3a0f493a8f21997260e6bc6d7573f08bf > ./filelist.txt

          查看所有的文件列表
          cat ./filelist.txt
 

      3. 导出zip 归档包


          git  archive  --format  zip  --output    e:\monitor.zip   master  

      

      4. 针对工程打tag


          >git   tag (see  tag)

          >git   tag  -r (see remote tag)

          >git   tag   update-20110826 (create  local  tag)

          >git   push origin refs/tags/update-20110826(create  remote  tag)

          >git   tag -d  update-20110826 (delete  local  tag)

          >git   push origin  :refs/tags/update-20110826(delete  remote  tag)

 

      5. 将A仓库迁移到B仓库

          git  push  ssh://git@xxx.sohu.com/monitor.git   :master

          git  push  ssh://git@xxx.sohu.com/monitor.git   myzookepeer:master

          git  push  ssh://git@xxx.sohu.com/monitor.git   +myzookepeer:master

 

      6. 删除仓库分支

          git branch -D myzookepeer


      7. 修改全局用户名和邮箱
          git config --global user.name "username"
          git config --global user.email "email"

          

 

      参考: http://blog.haohtml.com/archives/10129

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值