Say I have two branches: `develop` and `feature`.

Assume I also have a file called `VersionNumber` which has the following 
content:

BUILD_NUMBER 1

I want to use Git hooks so that, when I merge `feature` into `develop`, the 
`BUILD_NUMBER` field gets incremented automatically. 

I thought about the following process using the `post-merge` hook:

 1. Check that branch being merged into is `develop`
 2. Update the `VersionNumber` file by incrementing `BUILD_NUMBER` by 1
 3. Add the updated file: `git add VersionNumber`
 4. Amend the commit: `git commit --amend -C HEAD --no-verify`

It all works fine until the final command. Git says I can't amend the 
commit in the middle of a merge (which is surprising to me, since I thought 
this was `post-merge`). 

Any advice on how I can do this (using `post-merge` or any other hook for 
that matter)? 

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to