我如何确定本地Git存储库最初从中克隆的URL? [英] How can I determine the URL that a local Git repository was originally cloned from?
问题描述
git config --get remote.origin.url
$ p
$ b如果您需要完整的输出或完整的参照完整性:
git远程显示源
当使用
git clone
来自GitHub或任何源代码库),克隆源的默认名称是origin。使用git remote show
将显示关于此远程名称的信息。前几行应该显示:C:\ Users \jaredpar\VsVim> git remote show origin
* remote origin
抓取URL:git@github.com:jaredpar / VsVim.git
推送URL:git@github.com:jaredpar / VsVim.git
HEAD分支:master
远程分支:
如果要使用脚本,您可以使用此答案中列出的第一个命令。
I pulled a project from GitHub a few days ago. I've since discovered that there are several forks on GitHub, and I neglected to note which one I took originally. How can I determine which of those forks I pulled?
解决方案If you want only the remote URL, or referential integrity has been broken:
git config --get remote.origin.url
If you require full output or referential integrity is intact:
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". Usinggit remote show
will display the information about this remote name. The first few lines should show: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:
If you want to use the value in the script, you would use the first command listed in this answer.
这篇关于我如何确定本地Git存储库最初从中克隆的URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!