325 votes
Accepted

Maintain hundreds of customized branches over master branch

You are completely abusing branches! You should have the customisation powered by flexibility in your application, not flexibility in your version control (which, as you have discovered, is not ...
user avatar
267 votes
Accepted

Why does everyone use Git in a centralized manner?

Ahh, but in fact you are using git in a decentralized manner! Let us compare git's predecessor in mindshare, svn. Subversion had only one "repo", one source of truth. When you did a commit, it was to ...
user avatar
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 ...
user avatar
  • 124k
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. ...
user avatar
143 votes
Accepted

Should the commit history be used to convey critical information to developers?

If I was going to look at upgrading to a newer version of a third party SDK, the last place I'd look is in the history of the source control system. If your product is using version 2.0 of an SDK ...
user avatar
  • 4,808
131 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 ...
user avatar
110 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 ...
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 ...
user avatar
106 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 ...
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 ...
user avatar
  • 54.7k
97 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 ...
user avatar
94 votes

Maintain hundreds of customized branches over master branch

Having 500 clients is a nice problem, if you had spent the time up front to avoid this problem with branches, you may never have been able to remain trading for long enough to get any clients. ...
user avatar
  • 4,574
85 votes

Choosing between Single or multiple projects in a git repository?

Christopher did a very good job of enumerating the disadvantages of a one-project-per-repository model. I would like to discuss some of the reasons you might consider a multiple-repository approach. ...
user avatar
  • 1,009
83 votes
Accepted

Maintaining Two Separate Software Versions From the Same Codebase in Version Control

Instead of having two code version with a common base you should design your application in a way to make those premium features plug-able and driven by configuration rather than different code bases. ...
user avatar
  • 1,285
81 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 ...
user avatar
  • 4,415
75 votes

Should images be stored in a git repository?

This question is pretty old but this is a common question that comes up when dealing with Git and there has some progress on modern solutions to storing large files in a Git repo since the last answer....
user avatar
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 ...
user avatar
  • 9,804
70 votes

Should the commit history be used to convey critical information to developers?

It should be noted in the commit history but the absolute best place to put the notice is in the same place you define the dependency. If you have for example a maven .pom file that declares your ...
user avatar
  • 8,027
59 votes

Should we include the NuGet PACKAGE folder in version control?

It depends. Check out Bart van Ingen Schenau's answer to determine if it's possible to ignore the packages folder at all. Basically: yes, NuGet is designed so that you can ignore the packages folder ...
user avatar
59 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 ...
user avatar
  • 706
53 votes

What does 'stage' mean in git?

Staging is a step before the commit process in git. That is, a commit in git is performed in two steps: staging and actual commit. As long as a changeset is in the staging area, git allows you to ...
user avatar
  • 5,235
52 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 ...
user avatar
  • 12.4k
47 votes

Should temporary code be put under version control and how?

All code is temporary. When I'm making changes I will introduce placeholders occasionally - that icon that I drew waiting for the real one from the designer, the function I know will call the library ...
user avatar
  • 48k
47 votes

How to enforce good/better source code control practices?

You're looking for a technical solution to a human problem. That rarely works. The reason for that is because if team members do not accept something (nor understand the implications), instead of ...
user avatar
46 votes
Accepted

Version control practice for Rewrites

You almost certainly want a new repository. The purpose of the repository is: to track history and changes so you can compare them easily to manage branches and merges rather than just emailing ...
user avatar
  • 1,663
45 votes

Is it a good practice to run unit tests in version control hooks?

Let me be the one to disagree with my fellow answerers. This is known as Gated Check-ins in the TFS world, and I expect elsewhere. When you attempt to check-in to a branch with the gated check-in, ...
user avatar
  • 107k
44 votes

Manager reading version control commits

Is there a social or technical solution to this? I suppose, but this isn't a problem. Your manager should know what you guys are doing. They should make sure that you're not doing a bunch of work ...
user avatar
  • 107k
43 votes
Accepted

How to use github, branches and automatic releases for version management?

You should look at git-flow. It's an excellent (and popular) branching model. Git Flow Summary Branching The main trunks that stay around forever are develop and master. master holds your latest ...
user avatar
  • 546

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