Bitbucket git bash 问题

Bit bucket git bash issue

您好,我正在尝试通过 Git Bash 将文件从本地更新到 bit bucket。当我尝试这个表扬时

$ git push -u origin 'master'

我收到类似

的错误
To https://test@bitbucket.org/test/a.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://test@bitbucket.org/test/a.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

请帮助 me.I 不知道为什么我会得到这个 error.I 我是 git Bash 的初学者 bucket.Please 帮帮我?

您的 local/master 未更新为 remote/master。先拉主再推。

$ git pull origin master
$ git push -u origin master

如果不起作用,则尝试变基 origin/master。

$ git pull --rebase origin master

正如您提到的(在评论中),您在本地有 untracked files。关注 Add -> Commit -> Rebase -> Push.

$ git add .
$ git commit -m 'added all'
$ git pull --rebase origin master
$ git push origin master