我创建了一个远程仓库,然后在本地创建了一个本地仓库:
git init
然后使用git add
将我需要的文件添加进去,然后使用git commit -m "something"
进行提交。
最后使用git push 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.
我是否需要在某些命令中喜欢远程和本地?如果需要,如果我已经添加并提交了,是否可以开始本地覆盖?
编辑:
显然我应该添加 git remote add origin ssh://git@example.com:1234/myRepo.git
但是我应该用什么替换ssh,以及我应该在哪里找到我应该添加的版本。
出现以下错误:
! [rejected] master -> master (fetch first)
error: failed to push some refs to
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.