Interview practice question
Push rejected because remote has new commits
Cloud & DevOps · Git and Version Control · Beginner
Your git push is rejected with a message saying the remote contains work you do not have. What do you do?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Someone pushed first.
- git pull (merge) or git pull --rebase.
- Resolve conflicts if any.
- Run tests.
- Push again; never force push shared branches.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.