我在GitHub上拖了一個有幾個福克的項目,但忘記了它是哪個福克。
当前回答
简短答案:
$ git remote show -n origin
或者,一个纯粹的快速脚本的替代品:
$ git config --get remote.origin.url
一些信息:
你想要起源正确吗? $ git 远程显示起源更好,只显示起源,但需要太长时间(测试在 git 版本 1.8.1.msysgit.1)。
我结束了: $ git 远程显示 -n 起源,似乎是最快的. 与 -n 它不会捕捉远程头(AKA 分支)。 你不需要这种类型的信息,对吗?
http://www.kernel.org/pub//software/scm/git/docs/git-remote.html
您可以在所有 3 个版本中使用 <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk>
如果你需要纯粹的速度,那么使用:
$ git config --get remote.origin.url
谢谢 @Jefromi 提到这一点。
其他回答
这只提供URL,这对脚本目的有用:
git config --get remote.origin.url
一个简单的方式是打开.git/config 文件:
cat .git/config
编辑:
vim.git/config 或
纳米.git/config
我认为你可以找到它在.git/config 和远程[“起源”] 如果你没有操纵它。
只需获取远程URL:
git config --get remote.origin.url
如果您需要完整的输出,并且您正在网络上,可以到达原产地的远程雷波:
git remote show origin
当使用 git clone (从 GitHub,或任何源存储器为该材料) 的默认名称为 clone 的来源是“起源”。使用 git 远程显示将显示有关这个远程名称的信息。
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:
如果你想在脚本中使用值,你会使用这个答案中列出的第一个命令。
我更喜欢这个,因为更容易记住:
git config -l
它将列出所有有用的信息,如:
user.name=Your Name
user.email=your.name@notexisting.com
core.autocrlf=input
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=https://github.com/mapstruct/mapstruct-examples
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
推荐文章
- 在Markdown Jekyll中使用图像说明
- 如何将git配置存储为存储库的一部分?
- 如何修改GitHub拉请求?
- 如何在Github和本地删除最后n次提交?
- 我如何调试git/git-shell相关的问题?
- 错误:无法使用rebase进行拉取:您有未分阶段的更改
- Git隐藏未缓存:如何把所有未分期的变化?
- 如何将文件附加到GitHub问题?
- 真实的恶魔
- 如何从另一个分支获得更改
- Git:权限被拒绝(publickey)致命-无法从远程存储库读取。克隆Git存储库时
- git reflog和log有什么区别?
- git推挂在Total line之后
- 重命名git子模块
- 如何添加谷歌分析跟踪ID到GitHub页面