Reputation: 1010
Sometimes I have to commit the same change across 2 dozen git repositories. I use a script, with the following command so I don't have to type :q two dozen times for the commit message I don't want to change:
git commit -a --amend --no-edit
Problem is, it never works. It still opens the editor and shows me the commit message that I don't want to change.
Can you see anything wrong with the command I've typed, or have any ideas why this wouldn't work? I am using git version 1.7.1, on centos version 2.6.32-573.18.1.el6.x86_64.
Upvotes: 1
Views: 1636
Reputation: 3549
This makes no sense. git commit --amend
is for modifying an existing commit. You are talking about making a new commit.
Do you really mean across many repositories, or do you perhaps mean across many branches?
git cherry-pick <commit>
to re-apply the same change to multiple branches. That will not require a commit message, it will pick up the message from the original one.git apply < <patch_file> && git commit -a -m <commit message>
. Your script can supply the patch and commit message.Upvotes: 1
Reputation: 142174
You have to add content before you commit.
If you don't add anything nothing will be commited,
You can use the -a
flag passed to the commit to also add your content.
If you want you can also type zz to exit vim instead of the :q.
Its about time to upgrade your git. Very old version with security issues.
Upvotes: 1