简体   繁体   中英

Default Git Commit Messages in Visual Studio

I'm looking to solve a problem with our CI build definition being triggered by merge commits. I'd like to find where Visual Studio stores the default merge commit message and edit it to include the ***NO_CI*** hack. So far I haven't found any reference to where the default commit message values are stored. I dug through the settings in the IDE and there aren't any that look like commit messages. Does anyone know where they're hidden?

Also, I've seen the related questions here on Stack but most are talking about cygwin and command line git usage, not the integrated Team Explorer panel in VS.

If recent Visual Studio does not use libgit2 anymore , then it should be using Git directly.

If you can, do a git config -l --show-origin (soon git config -l --show-origin --show-scope with git 2.26 to see all settings.

Look for a commit.xxx setting, like for instance commit.template .

If this is done by a CI, create a CI job which will do a git config -l --show-origin

That should show you the setting which allows said CI to use the right commit message.

This is a workaround

You can run bash or a PowerShell to check if the last commit contains a certain word. (I'm using bash here)

git log head -1 | grep -q 'Merge:'

Run it as a part of the pipeline, set a variable which can be used to validate as a part of a condition.

git log head -1 | grep -q 'Merge:' && _stop_pipeline=true

Use a condition for the stage or the step:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM