Sorry but I need to ask a question. I hope somebody here with actual experience could give me a hint
When you’re working with a Git repo both locally and also remotely (GitHub), do you normally merge feature branches locally or remotely? If you do so remotely, then I should delete the local branch altogether? If it’s locally, then I should never create the remote branch?
I’d love if someone could clarify.
Right now my situation is:
- I created a main branch locally and I connected a new GitHub repo (via https).
- Then I created a feature branch locally and started working on it. After working on some changes, I committed and pushed the branch (and set upstream to the respective
- Once I am satisfied with this branch working as I expect it, I commited and pushed again.
- Now, I’ve read that it’s recommended that branches be deleted as soon as you merge them, that is: not to keep them around.
- For that reason, I don’t know what should I do now, and I don’t find any specific explanation about it (in CodeCademy or Google in general, maybe I didn’t know how to search):
- should I make a compare and pull request with a merge in GitHub and delete the branch? If so, what do I do with my local feature branch?
- should I do the merge locally to my local
main? If so, what do I do with my remote feature branch?
I hope my doubt is clear and hopefully and hopefully someone kind enough could give me a hint as to what I am missing?
Thanks in advance!!