# Git pull --rebase and --reset-author-date

4 messages from 2024-12-11 to 2024-12-13. Participants: Ricardo Almeida, Junio C Hamano.
Thread: https://gitlist.dev/t/62627

## Ricardo Almeida, 2024-12-11 20:55

Subject: Git pull --rebase and --reset-author-date
Message-ID: <CAMKQPDZWgq_qCdaL_S8cYYn=wtZSJiq6nP5aqFjvUZcFSnrTzQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAMKQPDZWgq_qCdaL_S8cYYn%3DwtZSJiq6nP5aqFjvUZcFSnrTzQ%40mail.gmail.com

```
Hi,

I just learned about being able to use "git rebase master
--reset-author-date" to, as the name implies, reset the author date of
the branch commits that will move to the top.

But, when working in a branch, I use "git pull origin --rebase --stat
master:master" to update the master branch and rebase the current
branch with a single command (have it in an alias, to avoid typing it
all). So, I tried to execute "git pull origin --rebase
--reset-author-date --stat master:master" but it's not possible :(

error: unknown option `reset-author-date'

So, I was wondering if there's a similar option that can be used with
git pull --rebase or if I can request this feature to be added? :)

Regards,
Ricardo Almeida

```

## Junio C Hamano, 2024-12-12 03:16

Subject: Re: Git pull --rebase and --reset-author-date
Message-ID: <xmqqv7vpfv5g.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqv7vpfv5g.fsf%40gitster.g
In-Reply-To: <CAMKQPDZWgq_qCdaL_S8cYYn=wtZSJiq6nP5aqFjvUZcFSnrTzQ@mail.gmail.com>

```
Ricardo Almeida <ric.almeida@gmail.com> writes:

>
> error: unknown option `reset-author-date'
>
> So, I was wondering if there's a similar option that can be used with
> git pull --rebase or if I can request this feature to be added? :)

Can't you just use "git fetch && git rebase --..." instead of "pull"
short-hand?


```

## Ricardo Almeida, 2024-12-12 08:25

Subject: Re: Git pull --rebase and --reset-author-date
Message-ID: <CAMKQPDaB2fP-4n9_bw1fjB7JntZ1DWMSpO01h5uuMJ-LzzufdQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAMKQPDaB2fP-4n9_bw1fjB7JntZ1DWMSpO01h5uuMJ-LzzufdQ%40mail.gmail.com
In-Reply-To: <xmqqv7vpfv5g.fsf@gitster.g>

```
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, it's equivalent to doing:

git checkout master
git pull
git checkout myBranch
git rebase master

I have an alias for the pull command: "alias.rb=pull origin --rebase
--stat master:master", so, it would be handier to just add the
--reset-author-date to it but it's not supported atm :(

Regards,
Ricardo Almeida

```

## Junio C Hamano, 2024-12-13 03:31

Subject: Re: Git pull --rebase and --reset-author-date
Message-ID: <xmqq4j38fed9.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqq4j38fed9.fsf%40gitster.g
In-Reply-To: <CAMKQPDaB2fP-4n9_bw1fjB7JntZ1DWMSpO01h5uuMJ-LzzufdQ@mail.gmail.com>

```
Ricardo Almeida <ric.almeida@gmail.com> writes:

> 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.

```
