问题
My company is incorporating iRise for prototyping and it lacks any kind of versioning (unless making copies of your files with different file names = versioning). Anyway, we're using Git for our version control and since the typical iRise user here will be a graphic/web designer I want to automate the process as much as possible. I have a hot folder running an AppleScript that will push to a remote repository but I'm not sure how to add a message...
git push TestProject master
tried
git push TestProject master -m 'message'
but threw a switch error and showed a list of options, -m not being one of them...
is this possible or do you have to commit locally first and then push that to the remote and the message will be attached with it?
回答1:
You will have to do a commit ( after adding files)
git commit -m 'message'
and then push:
git push TestProject master
You cannot associate a message to the push.
回答2:
I think the question is legitimate, and is not completely answered by the answer above. Here is a workflow we use at our company (we use git flow):
- git flow feature start myFeature
- git commit -m 'commit for feature myFeature prior to code review'
- initiate code collaborator review with the commit above.
- git commit -m 'commit for code review comments/changes for myFeature round1'
- <same as above, maybe round2>
- git flow feature finish myFeature
- this merges to local develop branch, and deletes myFeature branch
- git push origin develop
Now it would be real nice if we could add a message like this during the push Step 7. like this:
git push -m 'Feature is code complete, code collaborator review ids 1234, 1235.' origin develop
Definitely, not a trivial case where someone is trying to push without commits, but a very useful step where you are annotating a specific push with metadata that provides some audit trail.
来源:https://stackoverflow.com/questions/10521628/git-push-to-a-remote-repository-with-a-message