CS FundamentalsModerateInfosys · Git interview
During git rebase main, a conflict stops the rebase. You edit the file to resolve it. What should you do next?
- A. git add the file, then git rebase --continue
- B. git commit -m "fix", then git rebase --continue
- C. git merge --continue
- D. git push --force, then git rebase --continue
Correct answer: A. git add the file, then git rebase --continue
Staging the resolved file marks the conflict as fixed; git rebase --continue then creates the rewritten commit and moves on. Committing manually would add an extra commit into the middle of the rebase.
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
- After git fetch, git status says: "Your branch is behind 'origin/main' by 3 commits, and can be fast-forwarded." Which statement is correct?
- A repository has untracked files temp.txt and out/build.log; .log is in .gitignore. What does git clean -fd remove?
- Assertion (A): You should not rebase commits that others have already based work on. Reason (R): Rebasing creates new commits with new…
- You run git branch -d experiment and Git refuses: 'the branch is not fully merged'. You force it with git branch -D. Which statement is…
- While running git rebase main on your feature branch, a conflict appears. In this situation, what do git checkout --ours and --theirs…
- A feature branch is merged into main with git merge --no-ff feature, although main had not moved since feature branched. What is the result?