尝试将我所有的项目代码推送到 bitbucket 时出错

Getting error while triong to push all my project code into bitbucket

我在尝试将我的第一个项目推送到 bit bucket 存储库时遇到以下错误。

Error:

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.

我按照以下步骤将我所有的项目代码推送到位桶存储库中。

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

这里我需要将所有代码推送到位桶存储库。请帮忙。

您需要先进行 git 拉动,然后才能进行推送。您的远程存储库有本地没有的更改

git pull

如果你的分支没有设置到上游主机,你也必须运行这个命令

git branch --set-upstream-to=origin/master master

Git pull documentation