将git local重新连接到GitHub远程,而不会丢失新的本地分支并提交 [英] Reconnect git local to GitHub remote without losing a new local branch and commits
本文介绍了将git local重新连接到GitHub远程,而不会丢失新的本地分支并提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在一些帮助下,我设法从致命的恢复本地git项目:不是git存储库(或任何父目录):.git
问题...
With some help I managed to recover a local git project from a fatal: not a git repository (or any of the parent directories): .git
issue... Why does git not recognise my local repository?
但是现在我的本地git在新的本地分支(在GitHub远程服务器上不存在)的前面,并且已与现有远程源断开连接.
But now my local git is ahead on a new local branch (that doesn't exist on the GitHub remote) and is disconnected from the existing remote origin.
-
git remote -v
不返回任何内容
git remote -v
returns nothing
如何重新连接本地git并将其推送到现有的GitHub远程服务器,而又不丢失其提交的新本地分支?
How do I reconnect and push the local git to the existing GitHub remote without losing the new local branch with it's commits?
推荐答案
添加遥控器:
git remote add origin http://github.com/user/repo.git
然后推送更改.
这篇关于将git local重新连接到GitHub远程,而不会丢失新的本地分支并提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文