Re: How to reset a branch on fedpkg?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 19. 12. 21 13:35, Chen Chen wrote:
Hi everyone,

I recently adopted an orphaned package. There are unwanted commits in a branch, and I'd like to reset this branch to be as same as rawhide. How can I achieve this?
It seems force push were not allowed on src.f . I also do not want to commit a "git revert" on it to avoid "x commits ahead - click to create new PR" on web UI.

Short answer: You cannot.

Long answer: You can create a merge commit that resets the branch to a working state and push that merge commit to both rawhide and your branches.

Assuming "mybranch" has the extra commit you don't want.

[gitfu (mybranch)]$ git l
* 66a3b65 2021-12-19 Miro Hrončok - Extra commit 2 (HEAD -> mybranch)
* ade24ea 2021-12-19 Miro Hrončok - Extra commit
* af838c5 2021-12-19 Miro Hrončok - Initial rawhide commit (rawhide)


[gitfu (mybranhc)]$ git switch rawhide
Switched to branch 'rawhide'
[gitfu (rawhide)]$ git switch -c merger
Switched to a new branch 'merger'
[gitfu (merger)]$ git l
* af838c5 2021-12-19 Miro Hrončok - Initial rawhide commit (HEAD -> merger, rawhide)


[gitfu (merger)]$ git merge --no-ff mybranch
Merge made by the 'recursive' strategy.
 gitfu.spec | 2 ++
 1 file changed, 2 insertions(+)
[gitfu (merger)]$ git l
* 677fcd7 2021-12-19 Miro Hrončok - Merge branch 'mybranch' into merger (HEAD -> merger)
|\
| * 66a3b65 2021-12-19 Miro Hrončok - Extra commit 2 (mybranch)
| * ade24ea 2021-12-19 Miro Hrončok - Extra commit
|/
* af838c5 2021-12-19 Miro Hrončok - Initial rawhide commit (rawhide)
[gitfu (merger)]$ git restore . --source=rawhide
[gitfu (merger *)]$ git commit -a --amend -m 'Restore branch mybranch to rawhide state'
[merger 2c3b417] Restore branch mybranch to rawhide state
 Date: Sun Dec 19 14:02:53 2021 +0100
[gitfu (merger)]$ git l
* 2c3b417 2021-12-19 Miro Hrončok - Restore branch mybranch to rawhide state (HEAD -> merger)
|\
| * 66a3b65 2021-12-19 Miro Hrončok - Extra commit 2 (mybranch)
| * ade24ea 2021-12-19 Miro Hrončok - Extra commit
|/
* af838c5 2021-12-19 Miro Hrončok - Initial rawhide commit (rawhide)


[gitfu (merger)]$ git switch rawhide
Switched to branch 'rawhide'
[gitfu (rawhide)]$ git merge merger
Updating af838c5..2c3b417
Fast-forward
[gitfu (rawhide)]$ git switch mybranch
Switched to branch 'mybranch'
[gitfu (mybranch)]$ git merge merger
Updating 66a3b65..2c3b417
Fast-forward
 gitfu.spec | 2 --
 1 file changed, 2 deletions(-)
[gitfu (mybranch)]$ git branch -d merger
Deleted branch merger (was 2c3b417).


[gitfu (mybranch)]$ git l
* 2c3b417 2021-12-19 Miro Hrončok - Restore branch mybranch to rawhide state (HEAD -> mybranch, rawhide)
|\
| * 66a3b65 2021-12-19 Miro Hrončok - Extra commit 2
| * ade24ea 2021-12-19 Miro Hrončok - Extra commit
|/
* af838c5 2021-12-19 Miro Hrončok - Initial rawhide commit


[gitfu (mybranch)]$ git diff rawhide
(nothing)

--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux