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

learn more… | top users | synonyms (2)

253
votes
11answers
24k 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 ...
246
votes
20answers
74k 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 ...
107
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. ...
98
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 ...
87
votes
10answers
6k views

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

I was naughty... Too much "cowboy coding," not enough committing. 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 ...
86
votes
10answers
6k 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 ...
78
votes
23answers
11k 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, ...
74
votes
12answers
6k views

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

Recently a conversation came up during a meeting regarding the rollback of a third-party SDK from the latest version and it was noted that the fact it shouldn't be used was already in the commit ...
74
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 ...
69
votes
12answers
11k 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 ...
68
votes
15answers
45k 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?
66
votes
4answers
11k 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 ...
64
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
7k 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 ...
60
votes
5answers
4k 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 ...
59
votes
7answers
5k 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 ...
59
votes
9answers
21k 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 ...
58
votes
2answers
22k 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: ...
52
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 ...
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 ...
46
votes
18answers
4k 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 ...
46
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 ...
45
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 ...
42
votes
5answers
2k views

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

Let's say that I am writing two different versions of the same software/program/app/script and storing them under version control. The first version is a free "Basic" version, while the second is a ...
42
votes
8answers
6k 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?
42
votes
5answers
21k 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 ...
40
votes
6answers
3k 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 ...
40
votes
11answers
3k 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 ...
40
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 ...
37
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 ...
37
votes
15answers
5k 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 ...
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
8answers
14k 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. ...
35
votes
2answers
8k 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 ...
30
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 ...
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
4answers
2k views

Should test data be checked into version control?

I'm writing some test code for a feature which processes PDF files. The basic idea behind the tests is that I point them towards some PDFs I've selected specially, they process them and I check that ...
29
votes
1answer
991 views

How to deal with a misnamed function in production code?

I've recently come across a Python library on GitHub. The library is great, but contains one glaring typo in a function name. Let's call it dummy_fuction() while it should be dummy_function(). This ...
28
votes
5answers
3k 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 ...
28
votes
8answers
5k 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?
28
votes
4answers
827 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? [closed]

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 ...
27
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 ...
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
11answers
4k 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, ...
26
votes
10answers
2k views

Should temporary code be put under version control and how?

Here are some examples of temporary/local code. It is needed in order to work with the codebase, but would be harmful to be part of it: Project files. Paths may need to be edited in order to reflect ...
26
votes
5answers
2k 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
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 ...
26
votes
2answers
15k views

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 ...