Search code examples
gitgit-commitgit-tag

Git - commit and tag in a single command


I am doing a commit in a git in a following manner:

git commit -m "message"

And then I am adding a tag

git tag -a v1.2 9fceb02

Is it possible to do this in a single command?


Solution

  • create a commitag.bat file, put it in one of the system PATH folder.

    git commit -m %1  
    git tag -a %2
    

    runcommitag "message" v1.2