How to undo/revert your last commit

git reset --soft HEAD^

How to tell which files git is tracking

git ls-files

How to get the short sha1 for a commit

git log --oneline

See also

How to use git stash

Undo your changes, show your stashes, and re-apply them

git stash
git stash list
git stash apply

Fix your email address in your commits

Use git submodules

Once your submodules are all set...

git submodule init
git submodule update

Remove a git submodule

To remove a submodule you need to:

  1. Delete the relevant line from the ''.gitmodules'' file.
  2. Delete the relevant section from ''.git/config''.
  3. Run ''git rm --cached path_to_submodule'' (no trailing slash).
  4. Commit the superproject.
  5. Delete the now untracked submodule files.


Learning git

fast forward

Home | About | Sitemap | Recent changes | © Philip Durbin | @philipdurbin |