git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git pull --rebase silently skipping commits
@ 2021-04-24 13:46 Alejandro Colomar (man-pages)
  0 siblings, 0 replies; only message in thread
From: Alejandro Colomar (man-pages) @ 2021-04-24 13:46 UTC (permalink / raw)
  To: git

Hello,

I started my PC and as always did a 'git fetch'.  I noticed that I 
forgot to push a commit the other day, so I had the following situation:

alx@msi:~/src/alx/config$ git tree -8
* 226e73c - Thu, 22 Apr 2021 22:28:37 +0200 (2 days ago) (tag: v0.8.0, 
origin/main, origin/HEAD)
|           Makefile: ffix - Alejandro Colomar
* 29cac15 - Thu, 22 Apr 2021 22:21:56 +0200 (2 days ago)
|           Makefile: remove unused option of read - Alejandro Colomar
* 5adc827 - Thu, 22 Apr 2021 22:20:16 +0200 (2 days ago)
|           Makefile: use INSTALL_DATA instead of plain install - 
Alejandro Colomar
* 28df09e - Thu, 22 Apr 2021 22:12:40 +0200 (2 days ago)
|           Makefile: Don't hardcode things - Alejandro Colomar
* 9cdb873 - Thu, 22 Apr 2021 22:11:32 +0200 (2 days ago)
|           ssh: Simplify code, and don't overwrite other contents of 
.ssh/config - Alejandro Colomar
| * 4d2f5ad - Thu, 22 Apr 2021 19:22:16 +0200 (2 days ago) (HEAD -> main)
|/            sudo: Rename user alex to alx - Alejandro Colomar
* ad1d205 - Thu, 22 Apr 2021 12:51:10 +0200 (2 days ago) (tag: v0.7.0)
|           hosts: Don't overwrite the hole file - Alejandro Colomar
* c5137b5 - Wed, 21 Apr 2021 14:14:34 +0200 (3 days ago) (tag: v0.6.2)
|           Makefile: ffix - Alejandro Colomar
alx@msi:~/src/alx/config$



Normally I would've run 'git rebase origin/main', but recently I knew 
about 'git pull --rebase', so I was tried it.  However, to my surprise, 
it silently skipped the local commit:

alx@msi:~/src/alx/config$ git pull --rebase
Successfully rebased and updated refs/heads/main.
alx@msi:~/src/alx/config$ git tree -8
* 226e73c - Thu, 22 Apr 2021 22:28:37 +0200 (2 days ago) (HEAD -> main, 
tag: v0.8.0, origin/main, origin/HEAD)
|           Makefile: ffix - Alejandro Colomar
* 29cac15 - Thu, 22 Apr 2021 22:21:56 +0200 (2 days ago)
|           Makefile: remove unused option of read - Alejandro Colomar
* 5adc827 - Thu, 22 Apr 2021 22:20:16 +0200 (2 days ago)
|           Makefile: use INSTALL_DATA instead of plain install - 
Alejandro Colomar
* 28df09e - Thu, 22 Apr 2021 22:12:40 +0200 (2 days ago)
|           Makefile: Don't hardcode things - Alejandro Colomar
* 9cdb873 - Thu, 22 Apr 2021 22:11:32 +0200 (2 days ago)
|           ssh: Simplify code, and don't overwrite other contents of 
.ssh/config - Alejandro Colomar
* ad1d205 - Thu, 22 Apr 2021 12:51:10 +0200 (2 days ago) (tag: v0.7.0)
|           hosts: Don't overwrite the hole file - Alejandro Colomar
* c5137b5 - Wed, 21 Apr 2021 14:14:34 +0200 (3 days ago) (tag: v0.6.2)
|           Makefile: ffix - Alejandro Colomar
* 5244a5c - Wed, 21 Apr 2021 14:12:05 +0200 (3 days ago) (tag: v0.6.1)
|           sshd: restart service after installing - Alejandro Colomar
alx@msi:~/src/alx/config$


When trying 'git pull --rebase=interactive', I see the following:

noop 

 

# Rebase 4d2f5ad..4d2f5ad onto 226e73c (1 command)


I'd expect 'git pull --rebase' to be an equivalent of 'git fetch origin 
&& git rebase origin/main'.  But this time I had to use rebase:

alx@msi:~/src/alx/config$ git reset 4d2f --h
HEAD is now at 4d2f5ad sudo: Rename user alex to alx
alx@msi:~/src/alx/config$ git tree -8
* 226e73c - Thu, 22 Apr 2021 22:28:37 +0200 (2 days ago) (tag: v0.8.0, 
origin/main, origin/HEAD)
|           Makefile: ffix - Alejandro Colomar
* 29cac15 - Thu, 22 Apr 2021 22:21:56 +0200 (2 days ago)
|           Makefile: remove unused option of read - Alejandro Colomar
* 5adc827 - Thu, 22 Apr 2021 22:20:16 +0200 (2 days ago)
|           Makefile: use INSTALL_DATA instead of plain install - 
Alejandro Colomar
* 28df09e - Thu, 22 Apr 2021 22:12:40 +0200 (2 days ago)
|           Makefile: Don't hardcode things - Alejandro Colomar
* 9cdb873 - Thu, 22 Apr 2021 22:11:32 +0200 (2 days ago)
|           ssh: Simplify code, and don't overwrite other contents of 
.ssh/config - Alejandro Colomar
| * 4d2f5ad - Thu, 22 Apr 2021 19:22:16 +0200 (2 days ago) (HEAD -> main)
|/            sudo: Rename user alex to alx - Alejandro Colomar
* ad1d205 - Thu, 22 Apr 2021 12:51:10 +0200 (2 days ago) (tag: v0.7.0)
|           hosts: Don't overwrite the hole file - Alejandro Colomar
* c5137b5 - Wed, 21 Apr 2021 14:14:34 +0200 (3 days ago) (tag: v0.6.2)
|           Makefile: ffix - Alejandro Colomar
alx@msi:~/src/alx/config$ git rebase origin/main
Successfully rebased and updated refs/heads/main.
alx@msi:~/src/alx/config$ git tree -8
* 72f6ab9 - Thu, 22 Apr 2021 19:22:16 +0200 (2 days ago) (HEAD -> main)
|           sudo: Rename user alex to alx - Alejandro Colomar
* 226e73c - Thu, 22 Apr 2021 22:28:37 +0200 (2 days ago) (tag: v0.8.0, 
origin/main, origin/HEAD)
|           Makefile: ffix - Alejandro Colomar
* 29cac15 - Thu, 22 Apr 2021 22:21:56 +0200 (2 days ago)
|           Makefile: remove unused option of read - Alejandro Colomar
* 5adc827 - Thu, 22 Apr 2021 22:20:16 +0200 (2 days ago)
|           Makefile: use INSTALL_DATA instead of plain install - 
Alejandro Colomar
* 28df09e - Thu, 22 Apr 2021 22:12:40 +0200 (2 days ago)
|           Makefile: Don't hardcode things - Alejandro Colomar
* 9cdb873 - Thu, 22 Apr 2021 22:11:32 +0200 (2 days ago)
|           ssh: Simplify code, and don't overwrite other contents of 
.ssh/config - Alejandro Colomar
* ad1d205 - Thu, 22 Apr 2021 12:51:10 +0200 (2 days ago) (tag: v0.7.0)
|           hosts: Don't overwrite the hole file - Alejandro Colomar
* c5137b5 - Wed, 21 Apr 2021 14:14:34 +0200 (3 days ago) (tag: v0.6.2)
|           Makefile: ffix - Alejandro Colomar
alx@msi:~/src/alx/config$


I wonder if it may be due to this text, which I don't really understand:

alx@msi:~$ man git-pull | sed -n '/-r, --rebase/,/^$/p'
        -r, --rebase[=false|true|merges|preserve|interactive]
            When true, rebase the current branch on top of the
            upstream branch after fetching. If there is a
            remote-tracking branch corresponding to the upstream
            branch and the upstream branch was rebased since last
            fetched, the rebase uses that information to avoid
            rebasing non-local changes.

What does it mean "the upstream branch was rebased since last fetched"?
May it be the reason that it skipped that commit?  Isn't 'git pull 
--rebase' designed for what I'm using it?  In this case it's not really 
necessary, but it removes the need for specifying the branch I'm on, 
which is why I preferred it over 'git rebase'.


Thanks,

Alex

-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
Senior SW Engineer; http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-24 13:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-24 13:46 git pull --rebase silently skipping commits Alejandro Colomar (man-pages)

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).