如何修复缺少的git远程详细信息?

编程入门 行业动态 更新时间:2024-10-28 07:33:51
本文介绍了如何修复缺少的git远程详细信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一些存储库克隆允许我这样做:

%git pull %git push

但其他储存库要求我输入:

%git pull origin master %git push origin master

< p我认为我在后一种情况下失去了一些东西 - 有人知道这里发生了什么(不)吗?我使用的是最新的git版本,显然没有很好地使用它。 解决方案

在编辑器中添加 .git / config 文件。

将此附加到文件末尾:

[branchmaster] remote = origin merge = refs / heads / master

这几乎只是一个别名,所以git默认从原始主机中获取。

Some repository clones I have allow me to do this:

% git pull % git push

But other repositories require me to type:

% git pull origin master % git push origin master

I think I am missing something in the latter case - does anyone know what is (not) going on here? I am using the latest git version, just obviously not using it well.

解决方案

If you cd into your repository directory and then open up your .git/config file in an editor.

Append this to the end of the file:

[branch "master"] remote = origin merge = refs/heads/master

This is pretty much just an alias so git knows by default to pull from origin master.

更多推荐

如何修复缺少的git远程详细信息?

本文发布于:2023-10-09 21:13:46,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:详细信息   git

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!