Quantcast
Viewing latest article 2
Browse Latest Browse All 4

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

Viewing latest article 2
Browse Latest Browse All 4

Trending Articles