Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I'm rather new to using git, so I'm not sure about the best practices regarding it. I have a feature branch branched off, and periodically when the feature needs to be updated I will add some commi...
#2: Post edited
- I'm rather new to using git, so I'm not sure about the best practices regarding it. I have a feature branch branched off, and periodically when the feature needs to be updated I will add some commits to the branch and then create a pull request.[^1]
- Is it a good idea to have a permanent branch for this feature, or should I delete it after merging and create a new branch whenever an issue comes up? Right now I'm doing the former, but I've also heard that branches should have a single purpose so I'm not sure if it's actually a good idea.
- Basically, should I do
- - Update feature branch -> Merge -> Update feature branch -> Merge
- ```
---O-----O---O---\___/___/___- ```
- or
- - Create feature branch -> Merge and delete branch -> Create new branch -> Merge and delete branch
- ```
---O-----O-O-----O---\___/ \___/- ```
- [^1]: It's for the Code Golf leaderboard, if you were wondering.
- I'm rather new to using git, so I'm not sure about the best practices regarding it. I have a feature branch branched off, and periodically when the feature needs to be updated I will add some commits to the branch and then create a pull request.[^1]
- Is it a good idea to have a permanent branch for this feature, or should I delete it after merging and create a new branch whenever an issue comes up? Right now I'm doing the former, but I've also heard that branches should have a single purpose so I'm not sure if it's actually a good idea.
- Basically, should I do
- - Update feature branch -> Merge -> Update feature branch -> Merge
- ```
- ---O--O---O--O----O---
- \__\_/____\__/____
- ```
- or
- - Create feature branch -> Merge and delete branch -> Create new branch -> Merge and delete branch
- ```
- ---O--O---O-O-----O---
- \__\_/ \___/
- ```
- [^1]: It's for the Code Golf leaderboard, if you were wondering.
#1: Initial revision
Is it a good idea to have a permanent branch for a feature?
I'm rather new to using git, so I'm not sure about the best practices regarding it. I have a feature branch branched off, and periodically when the feature needs to be updated I will add some commits to the branch and then create a pull request.[^1] Is it a good idea to have a permanent branch for this feature, or should I delete it after merging and create a new branch whenever an issue comes up? Right now I'm doing the former, but I've also heard that branches should have a single purpose so I'm not sure if it's actually a good idea. Basically, should I do - Update feature branch -> Merge -> Update feature branch -> Merge ``` ---O-----O---O--- \___/___/___ ``` or - Create feature branch -> Merge and delete branch -> Create new branch -> Merge and delete branch ``` ---O-----O-O-----O--- \___/ \___/ ``` [^1]: It's for the Code Golf leaderboard, if you were wondering.