exam questions

Exam AZ-400 All Questions

View all questions & answers for the AZ-400 exam

Exam AZ-400 topic 15 question 2 discussion

Actual exam question from Microsoft's AZ-400
Question #: 2
Topic #: 15
[All AZ-400 Questions]

You need to the merge the POC branch into the default branch. The solution must meet the technical requirements.
Which command should you run?

  • A. git rebase
  • B. git merge --squash
  • C. git push
  • D. git merge --allow-unrelated-histories
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
syu31svc
Highly Voted 2 years, 5 months ago
Selected Answer: A
Question #62 from Topic 7 is the same as this Answer is A
upvoted 5 times
warchoon
1 year, 11 months ago
No. This is for replacing, that is for overriding. Rebase is here, Merge is there
upvoted 3 times
dottLorenz
1 year, 11 months ago
No in Question #62 from Topic 7 you do a rebase of the master branch to the experimentation brach, in that case the feature became the new master, and also here. Is not an usual scenario, but could happen that you want to override the master with the commits of feature. answer is A
upvoted 2 times
...
...
...
Fadoua24
Most Recent 1 week, 3 days ago
Selected Answer: D
Opción más correcta: D. git merge --allow-unrelated-histories Porque el caso indica indirectamente que: POC tiene commits independientes. Se quiere que esos commits reemplacen el historial de la rama principal. Entonces, necesitas un comando que permita fusionar dos ramas sin historia común. Eso es exactamente lo que hace: git merge POC --allow-unrelated-histories Este comando fusiona todo el historial de POC al branch por defecto, reemplazando su contenido si resuelves bien los conflictos.
upvoted 1 times
...
hardinxcore
1 year ago
Selected Answer: A
As the commit history of the POC branch must be used instead of that of the default branch, you need to checkout the default branch, then rebase it on the poc branch.
upvoted 1 times
...
vsvaid
1 year, 1 month ago
Selected Answer: A
correct answer
upvoted 1 times
...
Pamban
1 year, 7 months ago
Selected Answer: A
this question appeared on today's (20/06/23) exam.selected A. scored 955. hope should be correct! cheers
upvoted 1 times
...
zellck
1 year, 7 months ago
Selected Answer: A
A is the answer. https://learn.microsoft.com/en-us/azure/devops/repos/git/pulling?view=azure-devops&tabs=visual-studio-2022#rebase Git rebase resequences the commit history of the target branch so that it contains all source branch commits, followed by all target branch commits since the last common commit. Another way to view it is that a Git rebase replays the changes in your target branch on top of the source branch history. If any source branch change conflicts with any target branch change, then Git will prompt you to resolve the merge conflict. Git rebase doesn't create a merge commit.
upvoted 4 times
zellck
1 year, 7 months ago
Gotten this in Jun 2023 exam.
upvoted 3 times
...
...
lknr
1 year, 11 months ago
Selected Answer: A
A.rebase "The commit history of the POC branch must replace the history of the default branch."
upvoted 2 times
...
petitbilly
1 year, 11 months ago
So the answer is: B. git merge --squash
upvoted 1 times
...
dottLorenz
1 year, 12 months ago
Rebase does not merge anything, only align the Poc branch to default branch. The requirement is to Merge the two branch, so response is B
upvoted 1 times
...
mrg998
2 years ago
Selected Answer: B
its b as its a PR
upvoted 1 times
mrg998
2 years ago
The correct answer is B. git merge --squash When using the --squash option, Git will take all the commits in the POC branch and combine them into a single commit, effectively replacing the history of the default branch with the commit history of the POC branch. It is important to note that this command will not move the POC branch but it will create a new commit in the default branch with all the changes from the POC branch, and the POC branch will remain unchanged.
upvoted 4 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...