How do I fix missing git remote details?

╄→尐↘猪︶ㄣ 提交于 2019-11-30 08:52:25
Brian Gianforcaro

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.

Or if you prefer, you can do the same thing Brian Gianforcaro proposed from the command line:

git config branch.master.remote origin
git config branch.master.merge  refs/heads/master

Also, to avoid having to do git push master, you can specify what branches to push in your Git config file, like so:

[remote "origin"]
        ...
        push = master
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!