找出您在Git中克隆的原始存储库的名称 [英] Finding out the name of the original repository you cloned from in Git

查看:105
本文介绍了找出您在Git中克隆的原始存储库的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当你使用语法来完成你的第一个克隆时:

When you do your first clone using the syntax

git clone username@server:gitRepo.git

是否可以使用本地存储库查找该初始克隆的名称? (所以在上面的例子中找到gitRepo.git)解决方案

Is it possible using your local repository to find the name of that initial clone? (so in the above example find gitRepo.git)

存储库和分支机构。在你的例子中,你应该寻找类似的东西:

In repository root, .git/config file holds all information about remotes repositories and branches. In your example you should look for something like:

[remote "origin"]  
    fetch = +refs/heads/*:refs/remotes/origin/*  
    url = server:gitRepo.git  

此外,git命令: git remote -v 显示远程存储库名称和URL。 origin远程存储库通常对应于原始存储库,从中克隆了本地副本。

Also, git command: git remote -v shows remote repository name and url. "origin" remote repository usually corresponds to the original repository, from which the local copy was cloned.

这篇关于找出您在Git中克隆的原始存储库的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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