You're collaborating with a team on a project, and you need to review changes made by another developer before merging them into the main branch. How would you do this in Git?

  • git diff HEAD..origin/branch-name
  • git fetch and git merge origin/branch-name
  • git log origin/branch-name
  • git pull origin branch-name
You would use git fetch to retrieve changes from the remote repository and then git merge origin/branch-name to merge the changes locally for review before merging into the main branch.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *