Questions tagged [branching]

Branching, in revision control is the duplication of an object under revision control so that modifications can happen in parallel along both branches.

Taken from Wikipedia:

Branching, in revision control and software configuration management, is the duplication of an object under revision control (such as a source code file, or a directory tree) so that modifications can happen in parallel along both branches.

Branches are also known as trees, streams or code lines. The originating branch is sometimes called the parent branch, the upstream branch (or simply upstream, especially if the branches are maintained by different organisations or individuals), or the backing stream. Child branches are branches that have a parent; a branch without a parent is referred to as the trunk or the mainline.

248 questions
298
votes
6 answers

Why squash git commits for pull requests?

Why does every serious Github repo I do pull requests for want me to squash my commits into a single commit? I thought the git log was there so you could inspect all your history and see exactly what changes happened where, but squashing it pulls it…
hamstar
  • 3,091
  • 2
  • 11
  • 6
233
votes
15 answers

New developer can't keep up with branch merges

I am the new developer - this is my first programming position. My issue is this: We use git - I cut a branch from our develop branch, then I start working on the minor task I've been assigned. It's very slow, because I'm inexperienced. By the time…
K--
  • 2,529
  • 3
  • 10
  • 12
184
votes
2 answers

Git branching and tagging best practices

I am currently learning to use Git by reading Pro Git. Right now I'm learning about branching and tags. My question is when should I use a branch and when should I use a tag? For example, say I create a branch for version 1.1 of a project. When I…
Code-Guru
  • 2,419
  • 3
  • 16
  • 17
149
votes
9 answers

Maintain hundreds of customized branches over master branch

Currently we have one master branch for our PHP application in a shared repository. We have more than 500 clients who are subscribers of our software, most of whom have some customization for different purposes, each in a separate branch. The…
Fernando Tan
  • 1,527
  • 2
  • 11
  • 9
147
votes
7 answers

Working on a branch with a dependence on another branch that is being reviewed

How does git help deal with the scenario below: I have a task broken down into 2 parts: backend task and frontend task. I make a pull request to merge the backend changes and wait for it to be merged (and address feedback). While waiting, I can't…
sul4bh
  • 1,661
  • 2
  • 11
  • 11
121
votes
5 answers

What are the advantages of using branching as a solo developer?

First off, I am aware that many questions have been asked about VCS as a solo developer, but they are often too broad. This concerns only branching, and still it has been marked as a duplicate...the supposed duplicate is, again, marked as another…
flatterino
  • 973
  • 2
  • 7
  • 9
91
votes
13 answers

To branch or not to branch?

Till recently my development workflow was the following: Get the feature from product owner Make a branch (if feature is more than 1 day) Implement it in a branch Merge changes from main branch to my branch (to reduce conflicts during backward…
SiberianGuy
  • 4,753
  • 6
  • 34
  • 46
79
votes
8 answers

Is it a good practice to use branches to maintain different editions of the same software?

We have a product that has a few different editions. The differences are minor: different strings here and there, very little additional logic in one, very little difference in logic in the other. When the software is being developed, most changes…
Tamás Szelei
  • 7,737
  • 7
  • 38
  • 42
61
votes
3 answers

Reusing a merged branch, good practice?

Currently, I used to create a new branch each time I have to add a new feature to my application. When my feature is finished and functional, I merge it with the master branch. But later, when I need to update this feature (like an improvement) is…
gaetanm
  • 763
  • 1
  • 5
  • 8
54
votes
5 answers

Is it better to merge "often" or only after completion do a big merge of feature branches?

Say multiple branches are being developed, A and B, as well as a incremental "bug fix" branch C. Now C is already "finished" and merged into master. A and B are still in development and will not be fixed before (maybe) another bug fix branch is…
paul23
  • 1,061
  • 1
  • 8
  • 14
50
votes
10 answers

Is it ever OK to commit non-working code?

Is it good idea to require to commit only working code? This commit doesn't need to leave the repository in a working state as: ... we are in early design stages, the code is not yet stable. ... you are the sole developer on the project. You…
Vorac
  • 7,073
  • 7
  • 38
  • 58
49
votes
2 answers

Where does refactoring belong in GitFlow branch naming model?

I recently started working with GitFlow model as implemented by bitbucket. And there is one thing that is not completely clear to me. We try to regularly address our technical debt by backlogging, planning, and implementing the refactoring tasks.…
AMA
  • 592
  • 1
  • 4
  • 8
44
votes
7 answers

How do you handle integrating code from multiple branches/developers each sprint?

Just got off a retro call where developers expressed concern around the integration of their stories into the master branch each sprint. The developers all code within their own branch and towards the end of the sprint they all merge into one master…
cookiecutter
  • 551
  • 1
  • 4
  • 5
40
votes
2 answers

Where should QA team do the testing in Gitflow branching model

We are a big team (10-12 developers and 4 qa) working on multiple projects with the same git repository. Its a spring boot based backend web service. We are looking for a good git branching and deploy strategy. we also have a qa team who ensures…
srini
  • 653
  • 2
  • 6
  • 12
39
votes
6 answers

Whose responsibility is it to fix merge conflicts?

Say that A is working on a branch based off master and B merges changes into the master branch, which introduces merge conflicts between A's branch and master. Whose responsibility is it to fix merge conflicts? I am not intending to be petty, so in…
K--
  • 2,529
  • 3
  • 10
  • 12
1
2 3
16 17