Git - 致命:远程来源已经存在

Bra*_*ble 22 git github github-for-windows

我无法使用remote命令远程创建原点:

$ git remote add origin https://github.com/LongKnight/git-basics.git
fatal: remote origin already exists.
Run Code Online (Sandbox Code Playgroud)

为了解决这个错误,我试过这个:

$ git remote -v origin
$ git remote -v show origin
Run Code Online (Sandbox Code Playgroud)

它不是将文件从我的本地存储库上传到远程:

$ git push -u origin master
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.
Run Code Online (Sandbox Code Playgroud)

每个存储库都有自己的来源吗?


解决方案:我正在使用Github或Git Shell附带的Powershell,因为它也被称为执行我的教程,一旦我切换到Git Bash它工作正常.

Von*_*onC 69

更容易一点:

git remote set-url origin https://github.com/LongKnight/git-basics.git
Run Code Online (Sandbox Code Playgroud)

这将取代现有的新原产地.