我从项目中获得了git
储存库,我已经删除了.git
文件。现在,我创建了一个新的git存储库,并尝试将代码推送到新的存储库中。为此,我使用了命令
对于第5点,错误为
拒绝xxx / project-sp.git的权限。严重:无法访问“ https://github.com/xxx/project-sp.git/”:所请求的URL 返回错误:403
然后,我从凭据管理器中删除了git凭据,并使用了命令git pull
我收到的消息是
warning: no common commits
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://github.com/xxx/project-sp
* [new branch] master -> origin/master
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> master
我应该怎么做才能将代码推送到新的git repo。我对git很陌生。我该如何解决这个问题?
更新:当我尝试使用命令git push --set-upstream origin master
时出现错误
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/xxx/project-sp.git'
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.