I'm going to switch to gitflow ! i'm confused if i should create all branches on remote or there are branches that should be on local ! thank you for your help.
In general, all branches exist on the remote repository, since they are public and should be accessible to other developers. Also, the remote repository is where merges take place if you use a repository management framework like gitlab
or github
.
When you start to implement a new feature, you will usually check out the develop
branch (so it needs to exist locally), and start a feature
branch from there. When you finished implementing your feature, you will want to merge it into the develop
branch. As I mentioned above, this is usually done after some sort of code review and thus happens on the remote repository, so you will have to push your feature branch there.
The same holds for hotfix branches that you branch off master
, so you might as well have that one locally.
And you have to create a release
branch somewhere, probably locally, and push it to the remote.
Long story short: As you see, all branches will end up in the remote repository and probably also in your local repository, although not all local branches have to be up to date all the time (you might want to pull changes to master
only if you plan to create a hotfix on top of them).
Of course, git
supports all kinds of workflows, and this is by no means mandatory. In the end it's up to you, but in my experience it mostly ends up as I described above.