簡體   English   中英

在現有 Git 存儲庫上創建客戶端/服務器文件夾結構

[英]Create client / server folder structure on existing Git repo

我有一個 git 存儲庫,現在我需要向其中添加客戶端和服務器文件夾。 即把所有Ionic相關的東西放到客戶端文件夾,把nodeJs相關的東西放到服務器文件夾。 我已經這樣做了:

在此處輸入圖像描述

我已經在 git 上有一個 git 存儲庫,沒有這個文件夾結構。 即基本 Ionic 4 應用程序的 git 存儲庫 那么我如何創建這種結構並將其推送到同一個存儲庫?

我試過這個。 但它給出了以下錯誤。 我也試過git pull ,但還沒有運氣。

    git push --set-upstream origin master To https://gitlab.com/my-repo/client.git  ! [rejected]        
master -> master (non-fast-forward) error: failed to push some refs to 'https://gitlab.com/my-
repo/client.git' hint: Updates were rejected because the tip of your current branch is behind hint: its 
remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: 
See the 'Note about fast-forwards' in 'git push --help' for details.

注意:實際上我的本地分支與遠程master是最新的。 在創建上述文件夾結構之前,我已經完成了它。

當您執行 git 拉取時,它會看到很多不相關的歷史記錄並拒絕從遠程分支合並和拉取代碼,正如您在錯誤堆棧中看到的那樣,請嘗試使用:

git pull origin master --allow-unrelated-histories

From https://github.com/NishuGoel/ExampleStackOverFlow
 * branch            master     -> FETCH_HEAD
CONFLICT (add/add): Merge conflict in README.md
Auto-merging README.md
CONFLICT (add/add): Merge conflict in .gitignore
Auto-merging .gitignore
Automatic merge failed; fix conflicts and then commit the result.

這會帶來不相關的更改,之后您可以通過手動解決您在編輯器中看到的沖突來合並更改。 (左側 VS Code 中的源代碼控制。)

最后提交,並推送結果。

希望這可以幫助!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM