# Git 切換上傳的網址(url) 以win10為例

以下提供不用下指令的方式更改 git

適用情境: 公司 gitlab有阻擋ip,變成居家上班,要改成對外ip

無法上傳會提示這樣

無法上傳會提示這樣

# 參考

Domain name change on Git Serveropen in new window

# 文字版

建議安置安裝VScode套件 才能和我底下的截圖對上(可跳過)

gitlensopen in new window

  1. 知道git資料夾的設定檔在哪邊
  2. 用編輯器開起 .git/config檔案 修改 url (要記得存檔~)
  3. 點上傳(push) 會要求驗證帳號身分
  4. 登入後點上傳(push) 成功~

# 看圖做

知道git資料夾的設定檔在哪邊

知道git資料夾的設定檔在哪邊 => 打開

修改ip  例如: http://192.168.0.1 ⇒ http://192.168.0.100.1

修改ip => 存檔 => 點上傳會要你登入

驗證身分 請登入git的帳號

驗證身分,請登入帳號 => 登入成功再次上傳

成功

成功畫面

Last Updated: 2023/4/30 下午10:22:44
Contributors: Richard Lin