So I want to bring commits of another branch till specific date only and I want them to appear on my branch as if they were my branch's commit. So when I push my branch to github those commits should appear on top.
For ex: I want to bring 'main' branches commits to my 'dev' branch till let's say 2021.10.12 and when I push my branch to GitHub the commits must appear till 2021.10.12.
How is it possible?
So I tried checkout main@{'date'} but it is creating new pointing address, asking if I would like to publish it as new branch. But that is not what I want
One way is :
About the first command :
main@{'date'}will not look for "the last commit before'date'", it will look into your local reflog (a history of what happened on your local repo), and get "the statemainwas in at'date'on your computer".So: suppose your main branch was 3 months old (you hadn't run
git pullfor a long time), and you rangit pulltoday,main@{yesterday}will translate to "the 3 month oldmain".If you want to get "the state of upstream main at
'date'", you can either:main)git log: