Git: Push to a remote repository with a message

前端 未结 2 581
暗喜
暗喜 2021-02-18 14:21

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

相关标签:
2条回答
  • 2021-02-18 15:05

    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):

    1. git flow feature start myFeature
    2. git commit -m 'commit for feature myFeature prior to code review'
    3. initiate code collaborator review with the commit above.
    4. git commit -m 'commit for code review comments/changes for myFeature round1'
    5. <same as above, maybe round2>
    6. git flow feature finish myFeature
      • this merges to local develop branch, and deletes myFeature branch
    7. 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.

    0 讨论(0)
  • 2021-02-18 15:13

    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.

    0 讨论(0)
提交回复
热议问题