File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,27 @@ git remote add repo-A https://example.com/repo-A.git
157157git push repo-A main --force # 此处main表示想要推送的仓库B的分支名称,如果仓库A存在main分支,会覆盖提交
158158```
159159
160+ ##### 外部代码迁移到内部仓库
161+ ``` bash
162+ git clone git@github.com:test/test.git
163+ cd dify
164+
165+ git remote add origin ssh://git@[域名]/test/test.git
166+ // company为自定义名称,无限制
167+ // ssh://git@[域名]/test/test.git为提前建好的空项目
168+ // 执行add后,执行git remote可以看到origin和company两个远端分支
169+
170+ git push company main // 推送main分支到company远端
171+ git push company 1.5.1 // 推送标签1.5.1到company远端, 根据实际修改
172+
173+ // code fork sync
174+ // ssh://git@[域名]/test/test_fork.git
175+ cd [项目名] // [项目名]替换为真实的路径
176+ git remote add dify ssh://git@[域名]/test/test.git
177+ git fetch dify tag 1.5.1
178+ git push --tag
179+ ```
180+
160181##### 切换git库的两个方法
161182``` bash
1621831. 重新git clone项目;
@@ -166,4 +187,3 @@ git push repo-A main --force # 此处main表示想要推送的仓库B的
166187### ❌尽量不要使用的命令❌
167188##### 强行推送tag到远端
168189` git push --force `
169-
You can’t perform that action at this time.
0 commit comments