Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Most efficient command to squash git commands

  • 23-11-2021 6:49pm
    #1
    Registered Users, Registered Users 2 Posts: 5,659 ✭✭✭


    Bonus points for readability.


    So each pull request, we have a shedload of commits. Id like to just have 1 overall commit with the difference between HEAD and this


    I'm aware of commit --amend but this isn't an option (long story). Any idears?



Comments

  • Registered Users, Registered Users 2 Posts: 2,040 ✭✭✭Colonel Panic


    Can’t you just view the diff of all commits?

    Anyway, you could soft reset the last N commits and then add and commit all the changes.

    Or interactive rebase let’s you do something similar.

    Problem is, this rewrites history so only really do this locally.



  • Registered Users, Registered Users 2 Posts: 2,013 ✭✭✭lynchie


    If all commits for a pull request are on a branch e.g. bugfix/abc or feature/abc then you can do a git merge -squash onto master which will create one commit? Bitbucket has that feature when merging pull requests and I assume GitHub and gitlab have similar?



Advertisement