摸鱼之----- git-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