CS FundamentalsHardProduct-company MCQ pattern
git push origin main is rejected with a 'non-fast-forward' error. What does it mean, and what is the correct fix on a shared branch?
- A. Your local branch is behind on tags; run git push --tags
- B. The remote main has commits you do not have; fetch and integrate them (git pull or git pull --rebase), then push again
- C. Your commits are too large; split them and push again
- D. The remote branch is protected; rename your branch and push
Correct answer: B. The remote main has commits you do not have; fetch and integrate them (git pull or git pull --rebase), then push again
A push is accepted only if it fast-forwards the remote branch. Someone else pushed first, so you must integrate their commits locally and push again. git push --force would overwrite their work and is the wrong fix on a shared branch.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- Which document records what a system must do — its functional and non-functional requirements — as agreed with the client before design…
- Before a sale, a team checks that its shopping site still responds well with 10,000 concurrent users, the expected peak. Which type of…
- Which of the following is a NON-functional requirement for an online banking app?
- An age field accepts integers from 18 to 60 inclusive. Which set of test values corresponds to ROBUST boundary value analysis for this…
- “Are we building the product right?” — checking that each phase’s output conforms to its specification, for example through reviews and…
- Which Git command shows, line by line, the commit and author that last modified each line of a file?