This is a rewrite of an answer I wrote for Piazza @724. A plain text version is reproduced here (with typos reproduced verbatim).
Another day of cs400 submit causing mayhem with its
reckless git pull --no-edit, creating ugly commit
histories *with* its already heinous commit messages.
Git makes branching cheap, but that does not mean branching is always the good idea -- or even make it the right one, so to speak.
The ugly right half of the diagram above.
submit commit) and old (the
NEW#2 commit). The question now is who in the
world it preserves the old HEAD for, and the answer is absolutely
no one, other than the short life span it existed
*exclusively* on the author's local repository.git reset --hard ORIG_HEAD and
git log --oneline --graph.)The based left half of the diagram above. (Pun intended.)
NEW#2 were pushed elsewhere, it would not
be happy to see that this new history contradicts its knowledge of
the old NEW#2 (With Git jargon this is to say that
such a push is non-fast-forwardable.
pushing this rebased history. This, as I have discussed, is an
unrealistic scenario; local development stays local, and there
should absolutely be zero harm in discarding something that is
*in nature* a work-in-progress.git rebase origin/master (or
whatever they call the default branch these days).
With git-pull(1), it can look like
git pull --rebase origin master, which looks
like a lot to type, but you'd have to
do the same to with --no-ff to merge anyways
(if we can all stop ignoring that the devious
cs400 init tramples over your user config
and forcifully sets pull.rebase to
true).Note that I am not talking about merge/rebase workflow in a *collaborative* environment; that opens a whole wormhole of problems, ones that are oftentimes overwhelmingly social. I only focus on Git when used by one person.