User login

See what's about to be committed when using git, and remove something before committing

git diff of files that have been staged ie 'git add'ed
git diff --cached

http://www.commandlinefu.com/commands/view/1242/git-diff-of-files-that-have-been-staged-ie-git-added

$ git commit ...
$ git reset --soft HEAD^ (1)
$ edit (2)

And just commit again.

http://www.kernel.org/pub/software/scm/git/docs/git-reset.html

git revert could have worked, but the working copy must be clean (git stash should have been able to do that)

http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#cleaning-up-history

Searched words: 
git see what's about to be committed diff git diff staged git remove from staging git undo commit git roll back commit

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.