Git commit to origin/master

Added by Ben Lipman over 1 year ago

I need to replicate the mechanism we have in TFS. The build server increments the semantic version in a header file ( then on success, it needs to commit this change back to the same branch it came from so everyone has the new version.

As of 1.8.5, I only see this mechanism commiting to a new tag and no one gets the change without someone merging this commit back into main branch.

These are the commands coming from the git source control block.

    <sourcecontrol type="filtered">
      <sourceControlProvider type="git" 
        <executable>"c:\program files\git\cmd\git.exe"</executable>
        <tagCommitMessage>CCNet Release v{0}</tagCommitMessage>
          <pattern>CruiseControl.NET .*</pattern>
git checkout origin/master #results in a detached HEAD, no local branches
###build,edit version.h, etc####
git commit --all --allowempty -m "CCNet Release v1.0.0.1314" 
git tag -a -m "CCNet Release v1.0.0.1314" v1.0.0.1314
git push origin tag v1.0.0.1314

This does not get the changes in the remote master branch.