尝试将我的第一个项目推送到位桶存储库时,我收到以下错误。
错误:
To https://subhrajyoti@bitbucket.org/subhrajyoti/oditek_project.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://subhrajyoti@bitbucket.org/subhrajyoti/oditek_project.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.
我按照以下步骤将所有项目代码推送到bit-bucket存储库。
1-git init
2-git add -A
3-git commit -m "Initial Commit"
4-git status
5-git remote add origin https://subhrajyoti@bitbucket.org/subhrajyoti/oditek_project.git
6-git push -u origin master
这里我需要将所有代码都推送到bit-bucket存储库。请帮忙。
答案 0 :(得分:0)
你需要做一个git pull才能做出推动。您的远程存储库包含本地没有的更改
git pull
如果您的分支未设置为上游主站,则您还必须运行此命令
git branch --set-upstream-to=origin/master master