如何修复缺少的git远程详细信息? [英] How do I fix missing git remote details?

查看:139
本文介绍了如何修复缺少的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远程详细信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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