ImiChau
ImiChau

Reputation: 81

Problem with subtrees and signed commits in GitHub

We are working with GitHub as repository and all the commits must to be signed.

All team members have configured Git to sign the commits with their own SSH key.

Everything is working fine, but the subtrees.

Every time the command git subtree add --prefix {local directory being pulled into} {remote repo URL} {remote branch} --squash is executed, a couple of local commits are created, and both are not signed; this means that when we executed the push command to upload these changes to GitHub the process is blocked because it contains unsigned commits.

Any idea about how to solve this issue?

Upvotes: 1

Views: 100

Answers (1)

IanEdington
IanEdington

Reputation: 526

Although it's not ideal I've found that it is possible to amend merge commits after the fact.

This command will sign the most recent commit

git commit -S --amend

Putting it together this will get you a signed merge commit

git subtree add --prefix {local directory being pulled into} {remote repo URL} {remote branch} --squash

git commit -S --amend

Upvotes: 1

Related Questions