This rejection message indicates that there are changes in the remote branch that have not been merged into the current branch, "dev-handover". Before you can push your changes, you need to merge the remote changes into your local branch.

To merge the remote changes, you can follow these steps:

  1. Fetch the latest changes from the remote repository:

    git fetch origin
    
  2. Switch to the "dev-handover" branch:

    git checkout dev-handover
    
  3. Merge the remote changes into your local branch:

    git merge origin/dev-handover
    
  4. Resolve any conflicts that may arise during the merge process. Git will mark the conflicting lines in the affected files. Open these files, resolve the conflicts, and save the changes.

  5. Once the conflicts are resolved, add the modified files to the staging area:

    git add .
    
  6. Commit the merged changes:

    git commit -m "Merge remote changes into dev-handover"
    
  7. Finally, you should be able to push your changes to the remote repository:

    git push origin dev-handover
    

After completing these steps, your local branch "dev-handover" will be up to date with the remote changes, and you should be able to push your changes without encountering the rejection message

Push of the current branch dev-handover was rejectedRemote changes need to be merged before pushing

原文地址: https://www.cveoy.top/t/topic/iHH0 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录