lazyload the images

最新精選 Featured post

異世界穿越作品整合

訂閱


每月雙數周日為固定發佈日

本站內任何媒體的內容,包括但不限於 影片/聲音檔/文章/圖片,純屬資訊分享和教學用途, 本站內容只作為一般用途,它並沒有考慮您的個人需要、投資目標及特定財政狀況。 本站內容並非投資意見,亦不構成任何投資產品之要約、招攬或建議購買或出售任何存款或投資任何下述投資產品。

投資者須注意,所有投資涉及風險(包括可能會損失投資本金),投資產品的價格可升或可跌, 而所呈列的過往表現資料並不表示將來亦會有類似的表現。

投資者在作出任何投資決定前,投資者應進行所須或適當的獨立調查,包括評估所涉及的投資風險。

14/01/2026

Git from Azure DevOps to Bonobo

文章分類: ,



前言

上一篇架好了 Bonobo Git Server 6.5.0

要 migrate Git repository (repositories)


Git CLI

一定要用 Git CLI,海豚一直用 sourcetree,安裝時已附帶Git Bash 即Git 的 command prompt

唯獨最後1~2步必須用 Git command line


git clone --mirror <URL to my OLD repo location>

cd <New directory where your OLD repo was cloned>

git remote set-url origin <URL to my NEW repo location>

git push --mirror origin


Git Clone

Git Clone 有很多方法,用平常慣用的 Git Client 便可

例如 SourceTree 、 VS Git 、Git GUI


比如豚要clone QMS repository


Git GUI

當時豚犯了一個錯誤,本機的repository 未pull到最新

所以抄出來的 Testing 2少一項commit


Clone 打開 Git Bash

跑那兩句,轉 push 目的地和 push

git remote set-url origin <URL to my NEW repo location>

git push --mirror origin




SourceTree

一樣都是 Clone

remote set-url origin 可以經UI做,setting > edit

或按Terminal 打開Git Bash



git remote set-url origin <URL to my NEW repo location>

git push --mirror origin


事入username 和password



預期push --mirror 完成的結果



Verify 確認一次





入錯 Password

有留意細節的也看到,不知為什麼 SourceTree的Git Bash 分兩次問 username,password

Git GUI 打開的Git Bash 是一個Dialog一次過問 username,password


pwd 入錯,豚估3種可能,

  • 錯的,會記着,下次一直錯的
  • 對的,會記着,下次免輸入
  • 錯的不會記,下次再開 user credentials
  • 對的不會記,每次問 user credentials


假如要搬很多 repositories,而 repository 來自不同git server,有不同 user credentials

如它會記 user credentials 就麻煩,海豚順便找一下如何清記錄


if $ git config credential.helper returns manager, the password is stored in the windows credential manager, if it returns store, password is stored in a .git-credentials file in the user folder.




輸入 git config credential.helper

如結果是 manager 就儲存在 windows credential manager

如結果是 store 就儲存在 .git-credentials

It is located at %UserProfile%\.git-credentials, which corresponds to C:\Users\<username>\.git-credentials


豚的 git password 會記在系統,英文windows 直接search  windows credential manager 就有

中文windows 搜英文是沒有的,要由control panel 進去


windows credential manager > Windows Credentials 


刪除



Reference

Where is my remote git repository password stored on the local machine?

https://stackoverflow.com/questions/42584934/where-is-my-remote-git-repository-password-stored-on-the-local-machine

How to migrate GIT repository from one server to a new one

https://stackoverflow.com/questions/1484648/how-to-migrate-git-repository-from-one-server-to-a-new-one

No comments:

Post a Comment