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 ...
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 ...
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 ...
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. ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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.
...
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. ...
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.
...
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 ...
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....
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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, ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
version-control × 950git × 306
svn × 96
branching × 89
mercurial × 51
project-management × 50
team-foundation-server × 44
versioning × 42
github × 38
continuous-integration × 35
development-process × 34
programming-practices × 31
workflows × 30
release-management × 28
open-source × 27
dvcs × 26
merging × 26
teamwork × 22
database × 18
deployment × 18
source-code × 18
repository × 18
web-development × 17
testing × 17
builds × 17