惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
云风的 BLOG
云风的 BLOG
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
GbyAI
GbyAI
C
Check Point Blog
M
MIT News - Artificial intelligence
T
The Blog of Author Tim Ferriss
Jina AI
Jina AI
博客园 - 【当耐特】
U
Unit 42
月光博客
月光博客
腾讯CDC
Y
Y Combinator Blog
小众软件
小众软件
博客园_首页
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
The GitHub Blog
The GitHub Blog
博客园 - 聂微东
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
T
Tailwind CSS Blog

博客园 - 试试手气

Web Worker 入门 若依Ruoyi分离版替换 MyBatis-Plus 若依前端菜单管理中路由地址、组件路径、权限字符的使用 Spring Boot —— Spring Security Spring Boot —— 集成文档工具 Spring Boot —— Filter 过滤器 Spring Boot —— Cors 跨域 Spring Boot —— 集成 Druid Spring Boot —— 集成 MyBatis-Plus Spring Boot —— 集成 Springdoc Navicat 使用笔记 Datagrip连接SQLServer失败 Asp.net mvc 笔记 Asp.net Core 笔记 mybatis 笔记 SQLServer 笔记 Asp.net Core 全局异常处理 SqlSugar 实践笔记 Asp.net Core 基于Cookie的身份认证
Idea clone 项目推送到自有仓库
试试手气 · 2024-10-12 · via 博客园 - 试试手气

clone项目A后推送到自有仓库

  1. 将代码 clone 到本地 git clone https://projecta.git
  2. 手动删除 .git 目录 rm -rf .git
  3. 初始化新的仓库 git init
  4. 将本地代码添加到新的git仓库 git add .
  5. 提交本地代码 git commint -m "Initial commit of my new project"
  6. 将本地仓库与新的远程仓库关联 git remote add origin <https://newrepos.git>
  7. 推送远程 git push -u origin master

添加远程仓库并拉去合并到现有分支

  1. 添加远程仓库(可以命名为upstream) git remote add upstream <https://remoterepos.git>
  2. 拉取最新代码 git fetch upsteram
  3. 合并到自己的分支 git checkout my-branch, git merge upsteram/master
  4. 解决冲突(如果有)然后提交
  5. 推送到自有仓库 git push origin my-branch

posted @ 2024-10-12 20:47  试试手气  阅读(135)  评论()    收藏  举报