A programming discipline for tracking, storing and retrieving revisions of source code.

learn more… | top users | synonyms (2)

244
votes
11answers
21k views

I'm a Subversion geek, why should I consider or not consider Mercurial or Git or any other DVCS?

I try to understand the benefits of distributed version control system (DVCS). I found Subversion Re-education and this article by Martin Fowler very useful. Mercurial and others DVCS promote a ...
240
votes
20answers
68k views

What does SVN do better than Git? [closed]

No question that the majority of debates over programmer tools distill to either personal choice (by the user) or design emphasis, that is, optimizing design according to particular uses cases (by the ...
153
votes
31answers
22k views

Is it unusual for a small company (15 developers) not to use managed source/version control?

It's not really a technical question, but there are several other questions here about source control and best practice. The company I work for (which will remain anonymous) uses a network share to ...
105
votes
17answers
6k views

Should I tell someone that their commit caused a regression?

When you track down and fix a regression—i.e. a bug that caused previously working code to stop working—version control makes it entirely possible to look up who committed the change that broke it. ...
94
votes
18answers
6k views

When should I make the first commit to source control?

I'm never sure when a project is far enough along to first commit to source control. I tend to put off committing until the project is 'framework-complete,' and I primarily commit features from then ...
77
votes
10answers
5k views

What should I do when I've already waited too long between commits?

I was naughty... too much "cowboy programming". Now, here I am with an enormous commit. Yes, I should have been committing all along, but it's too late now. What is better? Do one very large commit ...
77
votes
10answers
4k views

Strategy for keeping secret info such as API keys out of source control?

I'm working on a website that will allow users to log in using OAuth credentials from the likes of Twitter, Google, etc. To do this, I have to register with these various providers and get a ...
76
votes
23answers
9k views

Why did Git get so much hype? …while others don't? [closed]

In the recent years, the hype around Git raised greatly. Everybody knows about Git, nobody knows about alternatives. Other ones like Mercurial seem to be unnoticed. Both have been released in 2005, ...
73
votes
22answers
4k views

How do I convince my fellow devs to WANT to add comments to source code commits?

I know that Subversion (what we're using at work) can be configured to require comments on commits, however I'm not in a position of power to simply turn this on. I know that my reason for commenting ...
69
votes
28answers
5k views

Is it possible for a good programmer to have never used version control? [closed]

I am looking for an expert programmer to help solve a difficult situation. The interviews so far have been surprisingly disappointing. The best candidate so far is a very experienced programmer who ...
66
votes
12answers
8k views

git for personal (one-man) projects. Overkill?

I know, and use, two version control systems: Subversion and git. Subversion, as of now, gets used for personal projects where I am the only developer and git gets used for open source projects and ...
63
votes
12answers
3k views

Is there a point to including a “change log” in every code file when you are using version control?

I was under the impression that a version control system eliminated the need to have "change logs" plastered everywhere in the code. I've often seen the continued use of change logs, including big ...
62
votes
10answers
6k views

I'm forced to write bad code. How do I save my face? [closed]

I'm only a junior developer but my job forces me to work with really terrible PHP code (think about the worst PHP code you've seen; then think about code twice as bad). I usually try to fix bugs and ...
59
votes
15answers
34k views

Why big companies use Perforce? [closed]

I heard about some big companies e.g. Google, Facebook use Perforce Are there any reason why SVN/Git cannot replace Perforce?
57
votes
5answers
3k views

Why does git use hashes instead of revision numbers?

I always wondered why git prefers hashes over revision numbers. Revision numbers are much clearer and easier to refer to (in my opinion): There is a difference between telling someone to take a look ...
53
votes
17answers
4k views

Alternatives to Professional Version Control

We're teaming up with some non programmers (writers) who need to contribute to one of our projects. Now they just don't like the idea of using Git (or anything for that matter) for version ...
53
votes
7answers
4k views

At what point is version control needed? [duplicate]

I work in embedded systems. Right now, my organization has two full-time programmers and two occasional programmers. It's rare that the same project is worked on by two programmers. All code is stored ...
53
votes
4answers
7k views

What is the benefit of git's two-stage commit process (staging)?

I'm learning git and I've noticed that it has a two-step commit process: git add <files> git commit The first step places revisions into what's called a "staging area" or "index". What I'm ...
48
votes
12answers
3k views

Database source control

Should database files(scripts etc.) be on source control? If so, what is the best method to keep it and update it there? Is there even a need for database files to be on source control since we can ...
47
votes
8answers
2k views

Should I expect my team to have more than a basic proficiency with our source control system?

My company switched from Subversion to Git about three months ago. We had weeks of advance notice prior to the switch. Since I'd never used Git before (or any other DVCS), I read Pro Git and spent a ...
46
votes
2answers
13k views

Choosing between Single or multiple projects in a git repository?

In a git environment, where we have modularized most projects, we're facing the one project per repository or multiple projects per repository design issue. Let's consider a modularized project: ...
45
votes
18answers
3k views

What Part of Your Project Should be in Source Code Control?

A fellow developer has started work on a new Drupal project, and the sysadmin has suggested that they should only put the sites/default subdirectory in source control, because it "will make updates ...
41
votes
9answers
14k views

Should images be stored in a git repository?

For a distributed team that uses Git and Github as version control, should images also be stored in the git repository? For the most part, the images won't be changed. The folder containing them will ...
40
votes
19answers
4k views

When is a version control commit too large? [closed]

I've heard in several places "Don't make large commits" but I've never actually understood whats a "large" commit. Is it large if you work on a bunch of files even if there related? How many parts of ...
39
votes
9answers
2k views

Code maintenance: To add comments in code or to just leave it to the version control?

We have been asked to add comments with start tags, end tags, description, solution etc for each change that we make to the code as part of fixing a bug / implementing a CR. My concern is, does this ...
39
votes
8answers
4k views

Version control for independent developers?

Do you think it's worth it to use version control if you are an independent developer, and if so, why? Do you keep the repository on your own computer, or elsewhere, where it can serve as a backup?
38
votes
16answers
6k views

Good idea to put bug numbers in a comment in the beginning of the source file? [closed]

Is it a good practice to put bug numbers in the file itself inside a header comment? The comments would look something like this: MODIFIED (MM/DD/YY) abc 01/21/14 - Bug 17452317 - npe in drill ...
38
votes
12answers
2k views

Should a developer always use version control [duplicate]

Possible Duplicate: Version control for independent developers? I've heard statements to the effect of: "Well it's just me working on this project so I don't need to put it under source ...
37
votes
6answers
2k views

Should unit tests be stored in the repository?

I'm a growing programmer who's finally putting unit testing into practice for a library that I'm storing on GitHub. It occurred to me that I might include the test suites in the repo, but as I look ...
36
votes
8answers
2k views

What is the term for a really BIG source code commit?

Sometimes when we check the commit history of a software, we may see that there are a few commits that are really BIG - they may change 10 or 20 files with hundreds of changed source code lines ...
35
votes
15answers
4k views

How can I convince cowboy programmers to use source control?

UPDATE I work on a small team of devs, 4 guys. They have all used source control. Most of them can't stand source control and instead choose not to use it. I strongly believe source control is a ...
32
votes
2answers
5k views

What is Google's repository like?

I heard Google has a giant private (internal) repository of all of their code and their employees have access to it so that when they are developing things they don't have to reinvent the wheel. I'd ...
31
votes
8answers
10k views

Should Git be used for documentation and project management? Should the code be in a separate repository?

I'm starting up a Git repository for a group project. Does it make sense to store documents in the same Git repository as code - it seems like this conflicts with the nature of the git revision flow. ...
31
votes
5answers
12k views

How do you achieve a numeric versioning scheme with Git?

My organization is considering moving from SVN to Git. One argument against moving is as follows: How do we do versioning? We have an SDK distribution based on the NetBeans Platform. As the svn ...
29
votes
10answers
2k views

Writing commit messages as a solo developer?

On my projects where the repository is shared between me and other programmers, I always write commit messages even if I'm the primary developer. But on those projects where I'm the solo developer ...
29
votes
6answers
1k views

Are Frequent Complicated Merge Conflicts A Sign of Problems?

On our team, we use Git as our source control. We have several areas of code that are almost independent but have some overlap. Lately we have been discussing workflows and approaches to using source ...
28
votes
4answers
801 views

Zero-knowledge code hosting? [closed]

In light of recent revelations about widespread government monitoring of data stored by online service providers, zero-knowledge services are all the rage now. A zero-knowledge service is one where ...
27
votes
6answers
2k views

Which DVCS (git or hg) is easier for programming students?

A bit of context: I'm in 3rd year of college. students are divided into teams of 4. Almost everyone will be working under windows (except a few like me who are on linux). As part of the school ...
26
votes
18answers
2k views

Is SourceSafe really safe?

Having spent all morning trying to check something in - I now realise I've lost a couple of days worth of work. Its happened before - and is apparently common occurrence with SourceSafe. Can ...
26
votes
5answers
1k views

Do I check generated code in to source control or not? [duplicate]

I'm developing a .Net application that uses google protocol buffers. Historically the application used the approach, advocated by the protobuf-net team, of decorating the classes with attributes ...
26
votes
8answers
4k views

Can you recommend a good commit message template / guidelines to enforce in the company? [closed]

In Git it's possible to set and enforce a good commit template. Can you recommend (preferably with argumentation) a good commit template / guidelines to enforce in the company?
26
votes
8answers
1k views

good replacement for commenting out code? [duplicate]

It bothers me to see commented out code and it seems often-times a symptom of developers not being proficient in advanced source control features, but on the other hand source control does not really ...
24
votes
4answers
874 views

When should the VCS history of a project be deleted? [duplicate]

I just refactored my project's entire codebase. So much so that even though it uses most of the same code base, things work in a radically different way. If the old version was 1.0, the new one would ...
24
votes
8answers
5k views

Best Version Control Habits For Solo Developer?

I'm a sole developer at my work and while I understand the benefits of VCS; I find it hard to stick to good practices. At the moment I'm using git to develop mostly web apps (which will never be open ...
23
votes
11answers
3k views

How often should I/do you make commits? [duplicate]

I am a recent (as of yesterday) college grad - BS in Computer Science. I've been a huge fan of version control ever since I got mad at an assignment I was working on and just started from scratch, ...
23
votes
5answers
1k views

Why do so many websites prefer “git rebase” over “git merge”?

One of the advantages of using a DVCS is the edit-commit-merge workflow (over edit-merge-commit often enforced by a CVCS). Allowing each unique change to be recorded in the repository independent of ...
23
votes
7answers
807 views

Using some kind of version control when working alone and with small projects?

Very often I'm working on small projects only for myself. I'm working on one machine, but recently I thought about using some kind of version control nevertheless. This would have some benefits as for ...
23
votes
11answers
1k views

Business case for decentralized version control systems

I searched and couldn't find any business reasons why git/mercurial/bazzr systems are better than centralized systems (subversion, perforce). If you were trying to sell a DVCS to a non-technical ...
22
votes
7answers
1k views

how to stay efficient when a build is almost always broken

I work in a middle sized team which shares the same source code and while have a continues integration in place, but as all of us has to work in the same branch, the build is almost always broken. ...
22
votes
11answers
2k views

How do I set up a source code control system for myself?

I program on my desktop in my office, but also sometimes at home in a different room on my laptop, and even away from home. What I need is a system that automatically or on-demand syncs my work from ...