Search code examples
azure-devopscommitazure-synapsepull-request

Is there a limit on number of commits in a single PR for Microsoft DevOps?


I am working with MS Azure Synapse Analytics (in MS DevOps) and received this warning when sending a Pull request:

This is not an error (I am still able to send the PR), but I was wondering if there is a limit on number of commits in a single PR, for MS DevOps?

Note: I am not asking about the number of objects committed, but the number of total commits.

Thanks


Solution

  • There is no explicit commit number limit in pull request. The waring will not affect the merge result once PR completed.

    I used local bash script to create 310 commits on dev branch, when creating PR to main branch, it has same warning with you.

    for i in `seq 1 310`; 
    do
        echo $i >> README.md
        git add .
        git commit -m "change $i"
        git push
    done
    

    enter image description here

    Once PR completed, the code is merged. enter image description here

    But it's not recommended to have some many commits in one Pull request, for best practice to use less commits, this helps to ensure a high quality of code review and avoid cognitive overload for the reviewers.

    You can also find similar answer in ticket here.