Untracked files between branches in Git

“I’m not ready to commit the changes locally yet.”

Commits in git are local things that can be undone, redone and re-re-done at will. It’s only when you push the commit somewhere that you need to pay attention.

Plus, commits are visible to local tools like gitk, and can have diffs taken of them and can be rebased onto other commits, etc. It’s a very powerful tool. Learn to use it.

I frequently do:

git add .; git commit -a -m 'WIP'

just to stash away everything in the current work tree if I think I might be interrupted. If I make a few more changes, I use:

git add .; git commit --amend

to update my “WIP” commit in-place. When I’m finally ready for the real commit, I just:

git reset --soft HEAD~; git reset

and now I can carefully control what the final commit will be.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)