Skip to main content
83 votes
Accepted

In code review, should I ask to do a refactor outside of the scope in a pull request?

There are several relevant trade-offs here: Review complexity. If a branch has more than one functional change commit or more than one refactoring commit it becomes time-consuming to review the ...
l0b0's user avatar
  • 11.6k
54 votes
Accepted

Why deploy to the development environment?

You deploy to dev because you can't actually do real integration testing without actually really running the code. You can call the environment something else like Staging, but if it's the lowest non-...
Ryathal's user avatar
  • 13.5k
28 votes

In code review, should I ask to do a refactor outside of the scope in a pull request?

Just nitpicking, but usually I try to do the refactor before the change: Commit 1: Refactored class hierarchy in preparation for feature XY-123 Commit 2: Implemented feature XY-123 Another one I ...
Hermine's user avatar
  • 289
23 votes
Accepted

Is cherry-picking commits into master (instead of merging) a good idea?

Cherry picking commits is useful when you need a specific change in multiple branches where merging other history is not desirable. This is a specific workflow outside of merging, because combining ...
Greg Burghardt's user avatar
16 votes

In git, is it a bad idea to create a tag with the same name as a deleted branch?

You can explicitly specify whether you want a branch or a tag by using full name: git checkout refs/heads/v1.5.2 or git checkout refs/tags/v1.5.2
mastahu's user avatar
  • 161
16 votes

In code review, should I ask to do a refactor outside of the scope in a pull request?

For me, it depends on if the main change is difficult to follow without the refactor. If it is difficult to follow, I'll ask for the refactor to be done as part of the pull request, in the interest of ...
Karl Bielefeldt's user avatar
16 votes
Accepted

How to maintain development,testing and production branches when the number of devs is around 50?

Your problems have existed for decades and people have realized that there isn't a good way to solve it without significantly altering their way of working. Thats where Trunk-based Development, ...
Euphoric's user avatar
  • 38.2k
14 votes

Why deploy to the development environment?

Often, the tests that are run as part of a build are done in a clean environment. The build server establishes a new database, and the tests are responsible for seeding the necessary data for test ...
Thomas Owens's user avatar
  • 85.9k
14 votes

What is the difference between trunk based development and gitflow?

On a "mechanical" level, you seem to understand both version control strategies and their branching models. I believe there is a philosophical component that you are missing. The main ...
Greg Burghardt's user avatar
12 votes
Accepted

Git-flow: How to create a hotfix release when there are future releases?

You don't want to inject these commits on master between the commits and tags for 1.2 and 1.3. Although you can rebase, introducing commits like this is a form of rewriting history and could introduce ...
Thomas Owens's user avatar
  • 85.9k
11 votes

Strategy for dealing with A/B tests and Gitflow

The way I've always seen it done is to have a single code base capable of serving both pages/views/forms. ie. Its Feature flagged and deployed with two or more configs, or the 'does the user get A or ...
Ewan's user avatar
  • 84.6k
9 votes
Accepted

Is there a recommended Git branch strategy for two products in the same repo?

The recommended strategy is "don't do it". The cleanest way to do this with git is to have three repos: Project A Project B Common libraries And then use git submodule(documentation here) to have both ...
frollo's user avatar
  • 214
9 votes

How to maintain development,testing and production branches when the number of devs is around 50?

Excellent answer by Euphoric here, but let me add another (additional) option, which also means a significant change to your current way of working: try to break down your product into individual, ...
Doc Brown's user avatar
  • 221k
8 votes
Accepted

Using Gitflow and Semantic Versioning: How to avoid version number conflicts when merging?

You cannot reasonably avoid this merge conflict. But it is a very minor conflict and easy to resolve during the merge – but make sure that the version number is only written in one source file. ...
amon's user avatar
  • 136k
8 votes
Accepted

Do we have distinct type of branches?

Not to get all philosophical, but a branch in git is an alternate reality of your code base — a parallel universe — in which a new feature or defect fix is developed in isolation from all ...
Greg Burghardt's user avatar
8 votes
Accepted

Git model: branches for features based on master

A few considerations stand out to me. Consider having your major redesign in a branch off of develop rather than in develop. Effectively, what is in develop should represent your next release. If you ...
Thomas Owens's user avatar
  • 85.9k
8 votes
Accepted

Isn't keeping the master branch intact essential for collaborating?

Scanning through all the four articles you linked to, it seems they are written from a perspective where the rule to keep "master" intact is assumed to be so basic that it is not worth mentioning. In ...
Doc Brown's user avatar
  • 221k
7 votes

Applying hotfix to intermediate commit on master

You are actually asking how to manage multiple productive versions. Gitflow does not cover this and it's a complicated topic. You can have a branch per supported version, e.g. version/1.9.0, and do a ...
marstato's user avatar
  • 4,638
7 votes
Accepted

What to do with historical SVN branches after switching to GitFlow?

Whether to keep the branches around or to convert them to tags is largely a matter of personal preference. Git has two kinds of tags: lightweight tags that are just a reference to a commit, and ...
amon's user avatar
  • 136k
7 votes
Accepted

Git branch model with QA and branches

Which Git branching model you should choose depends completely on the development process you want to use. The popular “git flow” you mentioned is concerned with products that have clear releases and ...
amon's user avatar
  • 136k
7 votes

What is the difference between trunk based development and gitflow?

I guess I need to write an answer explaining why the two are identical. Here you can see diagrams for both methods. Now lets rename "trunk" to "develop". You can see that the only ...
Ewan's user avatar
  • 84.6k
6 votes
Accepted

In GitFlow, why not merge from master to feature?

Working in a large enterprise codebase (my experience is with 20 fulltime devs), I feel the diagram misrepresents the amount of commits to master that occur relative to the commits to the feature ...
Flater's user avatar
  • 59.5k
6 votes
Accepted

With the "git flow" approach, why are release branches merged into develop?

What am I missing? It breaks the golden rule of rebasing: Never rebase a public branch.
Caleth's user avatar
  • 12.4k
6 votes

GitFlow question about develop and hotfix branches

My prefered explaination is : https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow I don't think commits to develop are strictly forbidden. You are just supposed to use ...
Ewan's user avatar
  • 84.6k
6 votes

How to properly manage bugfixes for released versions in git flow

You are on the right track. Hotfixes to production should be branched from the master branch. I know you're not calling it a hotfix, but it functionally is, as it will go before any new feature ...
Flater's user avatar
  • 59.5k
6 votes

Can 1.0.1 be launched right after 1.1.0?

SemVer does not contain any rules in which chronological order one has to develop, publish or deploy different branches which are not part of the same sequence. When the end result is a major release ...
Doc Brown's user avatar
  • 221k
6 votes

Can 1.0.1 be "applied" in 1.0.0 and in 1.1.0?

merge the branch hotfix-1.0.1 in hotfix-1.1.1 In most cases, yes. Assuming the changes from 1.0 to 1.1 haven't modified so much of the code base that this merge isn't possible or sensible any more, in ...
Doc Brown's user avatar
  • 221k
5 votes
Accepted

Git workflow for flexible features

In the gitflow model this situation would be considered a hotfix, where the prescription is exactly the solution you proposed, assuming the merge doesn't pull in other changes from develop that aren't ...
Karl Bielefeldt's user avatar
5 votes
Accepted

How can I control my versioning (perhaps with GIT), such that when I update a function (such as add an argument) it won't break the rest of the code?

NB: The question asked specifically mentions git, but the question could probably apply to version control generally, so I've tried to write a generic answer, although it certainly applies to git. ...
Ben Cottrell's user avatar
  • 12.1k
5 votes

Is there a recommended Git branch strategy for two products in the same repo?

At a source code and Git level there isn't a need for separate branching strategy. You need to configure your build/deploy solution to be able to deploy one or both as needed. If you want to make a ...
Ryathal's user avatar
  • 13.5k

Only top scored, non community-wiki answers of a minimum length are eligible