Git操作

1. Git仓库迁移

  1. 克隆旧仓库代码
bash 复制代码
git clone http://gitlab.example.com/lowcode/cctd-platform-datareport.git
  1. 拉取全部远程分支到本地
bash 复制代码
cd cctd-platform-datareport/
git branch -a
for branch in `git branch -r | grep -v '\->'`; do
   git branch --track "${branch#origin/}" "$branch"
done
  1. 重设远程仓库origin地址,推送代码
bash 复制代码
git remote rename origin upstream
git remote add origin http://172.16.92.64:3000/shiys/platform-datareport.git
git push -u origin --all
git push -u origin --tags
git remote rm upstream
相关推荐
2501_9032386525 分钟前
Git Bash:Windows下的强大命令行工具
windows·git·bash·个人开发
神明木佑2 小时前
datalist 是什么?以及作用是什么?
git
那片海还在吗4 小时前
使用 Git、Postman、Newman、Jenkins 与邮件构建自动化接口测试及通知流程
git·jenkins·postman
heeheeai12 小时前
git 国内源
git
the_seventh_dog13 小时前
git | 团队协作开发注意事项
git
yinshuilan16 小时前
今日运维之-Mac笔记本python环境问题
运维·git·python·brew
辄也16 小时前
git拉取远程分支到本地分支
git
皮克斯的进化之路17 小时前
Git原理+使用(超详细)
git
wrjwww17 小时前
【Git学习笔记】Git常用命令
笔记·git·学习
大乔乔布斯18 小时前
WSL,Power shell 和CMD, Git bash的区别
开发语言·git·bash