3 回答

TA貢獻(xiàn)1155條經(jīng)驗(yàn) 獲得超0個(gè)贊
如果只需要遠(yuǎn)程URL,或者您沒有連接到可以訪問遠(yuǎn)程存儲庫的網(wǎng)絡(luò):
git config --get remote.origin.url
如果您需要完整的輸出,并且您所在的網(wǎng)絡(luò)可以到達(dá)源所在的遠(yuǎn)程倉庫:
git remote show origin
使用時(shí)git clone(從GitHub或任何其他源存儲庫),克隆源的默認(rèn)名稱為“ origin”。使用git remote show將顯示有關(guān)此遠(yuǎn)程名稱的信息。前幾行應(yīng)顯示:
C:\Users\jaredpar\VsVim> git remote show origin
* remote origin
Fetch URL: git@github.com:jaredpar/VsVim.git
Push URL: git@github.com:jaredpar/VsVim.git
HEAD branch: master
Remote branches:
如果要使用腳本中的值,請使用此答案中列出的第一個(gè)命令。

TA貢獻(xiàn)1789條經(jīng)驗(yàn) 獲得超8個(gè)贊
如果您出于腳本目的需要這樣做,則只能使用
git config --get remote.origin.url
- 3 回答
- 0 關(guān)注
- 705 瀏覽
添加回答
舉報(bào)