* Git pull --rebase and --reset-author-date
@ 2024-12-11 20:55 Ricardo Almeida
2024-12-12 3:16 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Ricardo Almeida @ 2024-12-11 20:55 UTC (permalink / raw)
To: git
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Git pull --rebase and --reset-author-date
2024-12-11 20:55 Git pull --rebase and --reset-author-date Ricardo Almeida
@ 2024-12-12 3:16 ` Junio C Hamano
2024-12-12 8:25 ` Ricardo Almeida
0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2024-12-12 3:16 UTC (permalink / raw)
To: Ricardo Almeida; +Cc: git
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?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Git pull --rebase and --reset-author-date
2024-12-12 3:16 ` Junio C Hamano
@ 2024-12-12 8:25 ` Ricardo Almeida
2024-12-13 3:31 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Ricardo Almeida @ 2024-12-12 8:25 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Git pull --rebase and --reset-author-date
2024-12-12 8:25 ` Ricardo Almeida
@ 2024-12-13 3:31 ` Junio C Hamano
0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2024-12-13 3:31 UTC (permalink / raw)
To: Ricardo Almeida; +Cc: git
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-12-13 3:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-11 20:55 Git pull --rebase and --reset-author-date Ricardo Almeida
2024-12-12 3:16 ` Junio C Hamano
2024-12-12 8:25 ` Ricardo Almeida
2024-12-13 3:31 ` Junio C Hamano
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 NNTP newsgroup(s).