If you want only the remote URL, or if your are not connected to a network that can reach the remote repo:
(如果您只想要远程URL,或者您没有连接到可以访问远程仓库的网络:)
git config --get remote.origin.url
If you require full output and you are on a network that can reach the remote repo where the origin resides :
(如果您需要完整输出,并且您所在的网络可以访问原点所在的远程仓库:)
git remote show origin
When using git clone
(from GitHub, or any source repository for that matter) the default name for the source of the clone is "origin".
(当使用git clone
(来自GitHub或任何源存储库)时,克隆源的默认名称是“origin”。)
Using git remote show
will display the information about this remote name. (使用git remote show
将显示有关此远程名称的信息。)
The first few lines should show: (前几行应显示:)
C:UsersjaredparVsVim> git remote show origin
* remote origin
Fetch URL: [email protected]:jaredpar/VsVim.git
Push URL: [email protected]:jaredpar/VsVim.git
HEAD branch: master
Remote branches:
If you want to use the value in the script, you would use the first command listed in this answer.
(如果要使用脚本中的值,可以使用此答案中列出的第一个命令。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…