摸鱼之---git vs svn

代码提交存储方式

1.git : 暂存区 ----- 本地版本库 ------ 远程版本库 分布式
2.svn: 暂存区 ----- 远程版本库 集中式

git 提交合并代码操作流程

git checkout 切换分支
git checkout -b test 创建新分支test并切换到该分支
相当于: git branch test git checkout test

业务流上可能用到的步骤:
1、 git checkout -b test
2、 提交代码到当前test分支
git add .
git commit -m ‘test’
git push -u origin test
3、 拉取主分支或其他分支代码
git pull origin master
4、此时主分支代码已经到了test分支
如有冲突,解决冲突
5、请求合并代码

git 修改提交路径

方法一:
删除原有地址
git remote rm origin
修改为新的地址
git remote add origin NewGitURL

方法二:
vim ./git 修改配置

RPC failed; HTTP 403 curl 22 The requested URL returned error: 403 Forbidden

该问题出现,说明git权限不足

gitclone 项目,由于项目中存在文件过大clone不下来—解决方案

异常: 异常提示
remote: Enumerating objects: 2052, done.
efrror: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: protocol error: bad pack header

解决方案:
使用ssh 或者| 分层clone
1、 首次clone的层数定位在第一层: git clone 仓库地址 --depth 1
2、cd 项目目录
3、git fetch --unshallow

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值