Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git automatic merge commit message

Tags:

git

I have split one giant repo into several small ones. The old repo is still being comited to so I have to keep updating my new smaller ones.

I did this by doing this:

git subtree split -P some-sub-directory-in-my-large-repo/ -b branch-name-I-split

Obviously, I am trying to script this out, but I can't get past this:

cd my-smaller-repo
git pull /path-to-large-repo/ branch-name-I-split

And that of course brings me to the editor.

I need to just accept the default message and move on...

Any ideas?

like image 676
mmaceachran Avatar asked Jun 15 '26 17:06

mmaceachran


1 Answers

You can use the --no-edit flag to accomplish this.

From the git docs

--edit
-e
--no-edit
Invoke an editor before committing successful mechanical merge to further 
edit the auto-generated merge message, so that the user can explain and 
justify the merge. The --no-edit option can be used to accept the auto- 
generated message (this is generally discouraged). The --edit (or -e) 
option is still useful if you are giving a draft message with the -m 
option from the command line and want to edit it in the editor.

Older scripts may depend on the historical behaviour of not allowing the 
user to edit the merge log message. They will see an editor opened when 
they run git merge. To make it easier to adjust such scripts to the 
updated behaviour, the environment variable GIT_MERGE_AUTOEDIT can be set 
to no at the beginning of them.
like image 151
James Gawron Avatar answered Jun 17 '26 11:06

James Gawron



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!