2

I have a git subtree my-subtree in my main repo my-repo that links to a remote repo. I made a commit to files belonging to my-subtree in my-repo.

Then I wanted to push these changes back to the remote repo so I ran this command

git subtree push --prefix=remote_repos/my-subtree --squash git@github.com:my-userame/my-subtree master

It pushed the changes fine but the git commit message was lost! And I got this message instead

Merge commit '64cda2e4fd5e166e79cfc8e3c1edffa3fae40308'

How can I get my original git message into the remote repo when I perform the git subtree push? sintead of getting Merge commit message?

user391986
  • 29,536
  • 39
  • 126
  • 205
  • edited question: How can I get my original git message into the remote repo when I perform the `git subtree push`? sintead of getting `Merge commit` message – user391986 May 11 '14 at 05:55

1 Answers1

0

You will find in many places in contrib/subtree/git-subtree.sh code like the one in add_squashed_msg:

add_squashed_msg()
{
  if [ -n "$message" ]; then
    echo "$message"
  else
    echo "Merge commit '$1' as '$2'"
  fi
}

That refers to the subtree option -m:

m,message= use the given message as the commit message for the merge commit options for 'split'

(note: this isn't just for 'split')

Set -m to the last commit message.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250