我如何确定本地Git存储库最初从中克隆的URL? [英] How can I determine the URL that a local Git repository was originally cloned from?

查看:558
本文介绍了我如何确定本地Git存储库最初从中克隆的URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前我从GitHub上拉了一个项目。自从我发现GitHub上有几个叉子,我忽略了我最初使用哪一个叉子。

如果您只想要远程URL,或者参照完整性已被破坏:

  git config --get remote.origin.url 

$ 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". Using git 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆