Home > Back-end >  Why do we need to create a branch in our forked repository to push our changes and then create a pul
Why do we need to create a branch in our forked repository to push our changes and then create a pul

Time:09-26

I was following this tutorial to create a pull request. In step 3 they mention that it is a good practice to create a branch while working with repositories. But I feel that if I push changes to my forked repository's main branch, it wouldn't make a difference while making a pull request.

CodePudding user response:

Technically speaking, it won't make a difference. It's considered a best practice to keep your main (or master) branch as a "clean" snapshot of the repo you forked from, so you can always build it and see how the "original" repo would behave before your changes. Keeping the main/master branch clean of local changes also means you'll always be able to trivially rebase it from the upstream with no fear of conflicts.

  • Related