Re: emacs.git 'master' reset
<[email protected]> Mon, 27 Jul 2026 07:39:08 +0200
| Newsgroups | gmane.emacs.devel |
|---|---|
| Message-ID | <ambu/[email protected]> |
On Mon, Jul 27, 2026 at 02:37:44AM +0200, Michael Heerdegen via Emacs development discussions. wrote: > [email protected] writes: > > > Note that they get different hashes, because a commit's hash is > > chained with previous commit's hashes, so if one is missing (or > > otherwise changed) the whole history from then on gets different > > hashes. > > I wondered why there were different hashes this time. A commit's hash is a hash over the tree hash (which is a recursive hash over all directories and files) and other tidbits, like author, etc. Among them is the parent's hash, thus it is linked to its history. This [1] seems to be a good description. > No git guru here, but: apart from that suprise just hitting F u (aka > `magit-pull-from-upstream' in Magit) was good enough here. I don't know what F u does. If that corresponds to "git pull" and you were up to date before the action it should complain, since the remote branch has changed unexpectedly (that's the "change history" part) > My head > commit is in the master branch, and my master is some commits ahead of > origin/master. The rebasing onto the new origin/master happened > automatically. So I expect that for most people where the situation is > similar the procedure should not be complicated...? It shouldn't. Usually, the rebase will do -- sometimes you need that tougher "git reset --hard origin/master" which makes sure your local branch matches the remote (your local repo contains copies of the remote branches under origin/* [2]). The more drastic method will also throw away your local commits, should you have any [3], so caveat resettor. Cheers [1] https://shafiul.github.io/gitbook/1_the_git_object_model.html [2] "origin" and "master" are all names, they can be changed; I'm assuming defaults; "master" these days is more often spelled "main", but Emacs stuck with the older. [3] Never, ever commit to master/main unless you know what you are doing -- t
signature.asc
(application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCambu9QAKCRAFyCz1etHa RpvlAJwI+DgmYx79khcHklm4BHXAsWtiJwCfRrLarVD63pVqxL3yzQVHcgBnH1Y= =S3xb -----END PGP SIGNATURE-----