C
C#3y ago
Indeed

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
Cisien
Cisien3y ago
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
Indeed
IndeedOP3y ago
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
Cisien
Cisien3y ago
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
Indeed
IndeedOP3y ago
is there a way to move only one commit?
Cisien
Cisien3y ago
squash is also common, where your commits are "squashed" into one and pushed to the new branch
Indeed
IndeedOP3y ago
oh, i think this might work, will read on that thank you ❤️ !close
Accord
Accord3y ago
✅ This post has been marked as answered!

Did you find this page helpful?