Skip to main content
245 votes
Accepted

My office wants infinite branch merges as policy; what other options do we have?

Even though I use Git on the command line – I have to agree with your colleagues. It is not sensible to squash large changes into a single commit. You are losing history that way, not just making it ...
amon's user avatar
  • 135k
198 votes
Accepted

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

The advantages are mostly the same as for groups of developers. By using an always release-ready master branch, and feature branches for developing new features, you can always release off the master. ...
Sebastian Redl's user avatar
133 votes

Whose responsibility is it to fix merge conflicts?

Person A is the one who decides when to incorporate new changes from master, so Person A will perform the merge. Person A should certainly attempt to resolve merge conflicts on their own, but if any ...
Greg Burghardt's user avatar
111 votes

My office wants infinite branch merges as policy; what other options do we have?

I like Amon's answer, but I felt one small part needed a lot more emphasis: You can easily simplify history while viewing logs to meet your needs, but others cannot add history while viewing logs to ...
Karl Bielefeldt's user avatar
110 votes
Accepted

Is it bad practice to not delete redundant files right away from VCS but instead mark them as "To be deleted" with comments first?

The problem with adding a comment to a file that it should be deleted, instead of deleting it in source control and putting the explanation there, is the assumption that if developers do not read ...
Greg Burghardt's user avatar
107 votes
Accepted

How can a developer overcome their fear of merge conflicts?

Oh god yes. I broke the build my first time. Made me so gun shy I was hiding versions in folders. Of course delaying my check-ins just made things worse. I was in hell until I figured out what I ...
candied_orange's user avatar
105 votes

Is it bad practice to not delete redundant files right away from VCS but instead mark them as "To be deleted" with comments first?

Yes it is bad practice. You should put the explanation for the deletion in the commit message when you commit the deletion of the files. Comments in source files should explain the code as it ...
JacquesB's user avatar
  • 59.9k
98 votes

Do seasoned developers still have to deal with merge conflicts?

I think it's a little disingenuous to say that good developers never have merge conflicts, but they can surely reduce the number of times it happens. It's also very important to remember that ...
Berin Loritsch's user avatar
87 votes
Accepted

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

The longer a branch lives, the more it is able to diverge from the main branch and the messier and more complicated the resulting merge will be when it's finally finished. Ten small conflicts are ...
mmathis's user avatar
  • 5,498
71 votes

Should I record a bug that I discovered and patched?

It depends on who the audience of a bug report is. If it is only looked at internally by developers, to know what needs to be fixed, then don't bother. It's just noise at that point. Non-exhaustive ...
Caleth's user avatar
  • 11.5k
62 votes
Accepted

Git - What issues arise from working directly on master?

There are several problems when commits are directly pushed to master If you push a work-in-progress state to remote, the master is potentially broken If another developer starts work for a new ...
Gernot's user avatar
  • 736
60 votes
Accepted

How should source code unit tests affect semantic versioning?

Your unit tests are not part of your public API. By definition, the API is a software interface that allows two or more systems, applications, programs, or components to communicate. The existence or ...
Thomas Owens's user avatar
  • 83.4k
53 votes

Should I record a bug that I discovered and patched?

I'd say, it depends whether your product was released with the bug or not. If it's released with the bug that you found, then yes, create a bug-report. Release cycles can often be long and you don't ...
Pieter B's user avatar
  • 13.2k
49 votes

How do you manage your own comments on a foreign codebase?

Simply get into the habit of writing good comments - short, neutral, objective and non-redundant information about why a bit of code is doing what it's doing - and then the authors will probably be ...
Kilian Foth's user avatar
43 votes
Accepted

Should we include the NuGet PACKAGE folder in version control?

A lot of time has passed, and NuGet has changed, so here's a new answer. NuGet no longer creates a packages folder inside your source structure. Instead there is one in your user directory (%...
Sebastian Redl's user avatar
43 votes

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

Long running development Branching for a single person team would be useful for a long-running development feature that otherwise does not fit into your release cycle. You can take a branch for your ...
Paddy's user avatar
  • 2,623
35 votes
Accepted

How to structure commits when unit test requires refactoring

When working on existing code, it's common that you need to refactor the code before you can implement your feature. This is the mantra from Kent Beck: "Make the change easy (warning: this may be ...
nicoespeon's user avatar
34 votes

What's the best structure for a repository?

Based on my experience with open source, you should consider a few things before setting up a structure: Things to consider Language and Technology: Frameworks and languages dictate a lot of what your ...
EMarshall's user avatar
  • 449
34 votes

My office wants infinite branch merges as policy; what other options do we have?

Our issue is with long-term sidebranches -- the kind where you've got a few people working a sidebranch that splits from master, we develop for a few months, and when we reach a milestone we sync ...
Bradley Thomas's user avatar
29 votes
Accepted

Why use pull requests instead of merging

Pull requests provide for checks and balances, even if anyone can push to master. The biggest advantage is that they provide an opportunity for code review. The person that is responsible for ...
Thomas Owens's user avatar
  • 83.4k
27 votes

Do seasoned developers still have to deal with merge conflicts?

Probably the quote is incomplete: Good coders don't have to deal with merge conflicts... ... because good coders push force. Seriously, though, the only way to avoid merge conflicts is to work ...
Arseni Mourzenko's user avatar
27 votes

How can a developer overcome their fear of merge conflicts?

In general, individual developers will be responsible for merging their own work. Delaying things only means it's more likely for others to get code into your merge target, making the merge worse.
Telastyn's user avatar
  • 109k
27 votes
Accepted

Where to keep the code that I do not want in the main?

Although the question is different, much of my answer about what to do with abandoned branches applies to this as well. You say that maybe you will need the changes later. How sure are you that you'll ...
Thomas Owens's user avatar
  • 83.4k
25 votes

Should I record a bug that I discovered and patched?

You should do this if it is a bug that could have been reported by a customer. Worst case: You fix the bug, but nobody knows. Customer reports the bug. Your colleague tries to fix the bug, but cannot ...
gnasher729's user avatar
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
23 votes

How can a developer overcome their fear of merge conflicts?

Extreme Programming is (partly) based on the idea that if things are "hard" or "scary", we simply aren't practicing them enough. That's the thing: practice makes perfect. So, the ...
Jörg W Mittag's user avatar
23 votes

How can a developer overcome their fear of merge conflicts?

Yes and no In my experience, merge conflict are a result of not communicating. If you plan properly, you and your colleagues shouldn't have many merge conflict. The reason people 'fear' them, is ...
Martijn's user avatar
  • 697
22 votes

Do seasoned developers still have to deal with merge conflicts?

One colleague of mine ran into a developer who didn't have to deal with merge conflicts. He made some changes, merged them, and a few days later the changes were gone. He found out that someone else ...
gnasher729's user avatar
20 votes
Accepted

Should minified CSS be stored in Git?

"It depends." For normal development tracking, no. For cloud and DevOps deployments, however, it's often convenient, or even required. Most of the time, @ptyx is correct. Indeed, his "no" could be ...
Jonathan Eunice's user avatar

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