我有这些文件,想将它们推送到github。
自然,我运行了以下命令
git add *\*.py
git commit -m "cleaning"
git push origin master
但是,这产生了以下错误。
Abrahams-MBP:text_classification abrahammathew$ cd /Users/abrahammathew/Desktop/carecloud/carecloud_doc_extraction/text_classification/
Abrahams-MBP:text_classification abrahammathew$ git add *\*.py
Abrahams-MBP:text_classification abrahammathew$ git status
rebase in progress; onto 149cf03
You are currently rebasing branch 'master' on '149cf03'.
(all conflicts fixed: run "git rebase --continue")
nothing to commit, working directory clean
Abrahams-MBP:text_classification abrahammathew$ git commit -m "cleaning"
rebase in progress; onto 149cf03
You are currently rebasing branch 'master' on '149cf03'.
nothing to commit, working directory clean
Abrahams-MBP:text_classification abrahammathew$ git status
rebase in progress; onto 149cf03
You are currently rebasing branch 'master' on '149cf03'.
(all conflicts fixed: run "git rebase --continue")
nothing to commit, working directory clean
Abrahams-MBP:text_classification abrahammathew$ git push origin master
To https://github.com/springml/carecloud_doc_extraction.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/springml/carecloud_doc_extraction.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and 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.
Abrahams-MBP:text_classification abrahammathew$
看来我什至无法创建这些文件的本地提交。
如何使它正常工作?
答案 0 :(得分:3)
当您处于重新定位的中间时,可以使用git rebase --continue
继续它,也可以使用git rebase --abort
完全放弃它。之后,您可以添加并提交和推送文件。
答案 1 :(得分:2)
You are currently rebasing branch 'master' on '149cf03'.
(all conflicts fixed: run "git rebase --continue")
这很强烈:),表明您处于重新部署的中间。
您需要完成变基(git rebase --continue
)或中止它,然后您应该会开始正常工作。
您不应该在重新定位的中间进行推送。