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
相关推荐
呆萌的代Ma6 小时前
Git不强行推送,撤销最近几次的提交
git
透明的玻璃杯9 小时前
git应用
git
炸炸鱼.10 小时前
Git+Jenkins实战(一):从零搭建自动化发布与回滚系统(附完整代码)
git·jenkins
言66612 小时前
要忽略前端依赖包node_modules的文件在目录下 git暂存区消失
git
胡小禾13 小时前
Git Worktree
git
程序员小羊!13 小时前
18 GIt
git
怣疯knight13 小时前
Git 本地分支关联远程分支 常用命令汇总
git
ANNENBERG14 小时前
git分支开发管理
git
坤坤藤椒牛肉面14 小时前
GIT的使用
git
w32963627114 小时前
使用 OpenCode 在 Windows 上加速安装 Playwright 的完整指南
windows·git