Git Moving from feature branch to main [Answered]
Hi!
I have made a new branch for a new feature and have made some commits in there, how can I push the latest commit to main branch and to sync all the changes?
7 Replies
that's usually done with a pull request -- depends on the git service you're using, and what policies main has
if it's just a local repo, you can either merge your changes to main, or rebase them
however doesn't pull request move all the commits?
one of my commits is just "Failed at this library moving to new one" and wouldnt want that to end up in main
a pull request asks the owner of the branch to pull in your changes
how that pull happens is up to them, rebase is common, that will pull in all commits as they happened, merge is also common, that creates a new commit that includes your prior commits
is there a way to move only one commit?
squash is also common, where your commits are "squashed" into one and pushed to the new branch
oh, i think this might work, will read on that
thank you ❤️
!close
✅ This post has been marked as answered!