0

I want to edit the title (summary) and description of my last obligations commit on GitHub. Currently, my last time it is doing so is as follows https://zapodaj.net/320632245f106.png.html https://zapodaj.net/50f188728cdc2.png.html. Files are accompanied by descriptions of commits "JSONDoc documentation was exchanged for...", but I want versions to be given in these places as it is here https://zapodaj.net/127c307a57e0e.png.html.

That's why I want to edit my last commit and give the title 0.0.2.4 and in the description "JSONDoc documentation was exchanged for...". How to do this?

ifconfig
  • 6,242
  • 7
  • 41
  • 65
  • This command probably edits only commint on the local repository. –  Sep 09 '17 at 01:58
  • Next time, use the photos integration with imgur for your posts. It makes everything so much nicer and simpler. – ifconfig Sep 09 '17 at 02:11
  • I didn't see that more recent question, but I answered it in the comment of the previous one. – VonC Sep 09 '17 at 03:05
  • 1
    Possible duplicate of [How to modify existing, unpushed commits?](https://stackoverflow.com/questions/179123/how-to-modify-existing-unpushed-commits) – phd Sep 09 '17 at 10:15

1 Answers1

7

You can run git commit --amend and that will add to your previous commit, allowing you to change the message. You don't need to have anything to submit for this to work.

The commit message is separated into the title and the summary. Two lines separate the two. i.e.

Commit Title

Commit Description

Then push your change, and GitHub will reflect the new Commit title.

ifconfig
  • 6,242
  • 7
  • 41
  • 65
  • OK. I found that I can only add a description of git commit -m 'initial commit' I used GitHub desktop application sooner and during commit I had such fields to fill in https://zapodaj.net/71fcbc8abdbad.png.html **summary**(0.0.2.4) **description**( JSONDoc documentation was exchanged for...). –  Sep 09 '17 at 02:09
  • With this command I can only set the description, but no summary. –  Sep 09 '17 at 02:19
  • It will let you set both. The first line is the title, and if you hit enter twice, you can then type a description. – ifconfig Sep 09 '17 at 02:29
  • Also, @aedgftsdgh I instructed the use of `git commit --amend`, not `git commit -m`. What are you talking about? – ifconfig Sep 09 '17 at 02:40
  • @aedgftsdgh If my answer works for you, please mark it as accepted. I don't see a reason why is wouldn't, and if there is, I want to fix it. – ifconfig Sep 10 '17 at 04:05
  • @aedgftsdgh Again, please mark my answer as accepted. IF it doesn't work for you, just tell me, and I will fix it. – ifconfig Sep 14 '17 at 00:41