0

I'm not finding a command or option for seeing what a commit would do or what messages it would give... I ask because I tried one commit through a GUI and it gave an odd message that may or may not be a problem, so I want to see in certain situations what the commit will do and what messages it would print.

Is there a command/option for this or do I need to run some 3rd-party software?

user8865053
  • 101
  • 2
  • 11
  • What do you mean? You are the one who specifies commit message and what goes into commit. Whats there to display? –  Oct 31 '17 at 23:52
  • Which GUI are you using? – ElpieKay Nov 01 '17 at 00:12
  • By "messages" I mean "what the git command will print to the screen"... so the point was to see what it would do if it were to commit but didn't actually commit (or committed to show what would happen but then reverted automatically). I'm using Git Extensions, which formats its own commands (based on the buttons or selections you click), and you'd have to play with it to see its own way, but looking at the options it runs, it doesn't seem strange, and it may be more proper than I know how to do. In any case, I'm not sure specific GUI is the issue here. – user8865053 Nov 07 '17 at 18:36

1 Answers1

0

As far as I know, there isn't a way to try a commit without actually doing the commit.

But you can easily undo a commit in git:

$ git commit -m "Something terribly misguided"              (1)
$ git reset HEAD~                                           (2)
  1. this is you doing your commit
  2. is how you undo your most recent commit, it will remove the commit and keep all changes to your files.

For more detail see this answer: How to undo the last commits in Git?

Scott Newson
  • 2,745
  • 2
  • 24
  • 26