I made some commits and uploaded everything to Gitlab. So the master and origin master branches were on the last commit. I noticed a typo in the last commit and locally in the branch the master renamed it. After that, made a few more commits locally. I try to pour it all over again on Gitlab, but it gives an error. He writes that the origin master branch exists, but among the number of existing commits it does not exist and it is impossible to upload anything to it. Only local commits are shown via git log. How to overwrite data from master branch to origin master?

  • Add to the question what gives git status and git push - Boris Ustyantsev
  • $ git status on the branch of the master branch of your branch and of the origin and master of the diverits of each, respectively. (use "git pull" to merge the remote branch into yours) nothing to commit, working tree clean - Semyon
  • $ git push To repo.champer.ru/xxx/xxx.git ! [rejected] master -> master (non-fast-forward) error: failed to get some refs to ' repo.champer.ru/xxx/xxx.git ' hint: : its remote counterpart. Integrate the remote changes (eg hint: 'git pull ...') before pushing again. hint: See the git push - help for the details. - Semyon
  • one
    Well, the output of git status in pure English tells you what to do. "You are on the master branch, your branch and 'origin / master' are diverged and have 3 and 1 different commits. (Use git pull to merge changes from the remote branch into yours). There is nothing to commit" - Boris Ustyantsev
  • those. do git pull first. Merge changes if there are conflicts to solve them. Then do git push. - Boris Ustyantsev

0