3 ms·
The staging area is trivial to use effectively. Just: - edit files - git add -e - optionally git diff --staged (to review what will go in a commit) - optio
by cryptonector 9y ago
The staging area is trivial to use effectively.
Just:
- edit files
- git add -e
- optionally git diff --staged (to review what will go in a commit)
- optionally lather, rinse, repeat as needed
- git commit
Alternatively:
- edit files
- git add
- git commit
- lather, rinse, repeat
- git rebase -i origin/master (or whatever) and reorder/squash/edit/split commits as needed
For the latter's last step, sometimes the easiest thing to do is to squash all commits when you're done, then git reset HEAD^, then apply the git add -e && git commit loop in order to break up your work into logical commits.
When done, push.