git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git pull --rebase and --reset-author-date

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 13, 2024, 03:31 UTC
Message-ID
<xmqq4j38fed9.fsf@gitster.g>
In-Reply-To
<CAMKQPDaB2fP-4n9_bw1fjB7JntZ1DWMSpO01h5uuMJ-LzzufdQ@mail.gmail.com>
Ricardo Almeida <ric.almeida@gmail.com> writes:
Show 8 quoted lines
> Hi Junio,
>
>> Can't you just use "git fetch && git rebase --..." instead of "pull"
>> short-hand?
>
> But then it wouldn't update the master branch... When I'm on myBranch
> and execute "git pull origin --rebase --stat master:master" it does
> bring the master branch up to date, so...

"git pull origin master:master" is a bit unusal thing to say these days, but the "take their refs/heads/master, and copy it to my refs/heads/master (as long as it results in a fast-forward update and as long as I am not on 'master')" part of it can be reproduced by "git fetch origin master:master". So I do not see what you see as a problem. You are willing to be explicit to say that unusual "directly update my local branch 'master'" from the command line for your "git pull", so I would imagine you are also OK with doing the same with "git fetch" in the replacement.

Previous: Ricardo Almeida
Message 4 of 4 in “Git pull --rebase and --reset-author-date”
  1. Ricardo AlmeidaDec 11, 2024
  2. Junio C HamanoDec 12, 2024
  3. Ricardo AlmeidaDec 12, 2024
  4. Junio C HamanoDec 13, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.