Backport #39027 by @bircni Bound gitignore template selections at both web and API request boundaries before repository initialization. Co-authored-by: bircni <bircni@icloud.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>