Downsides to Git
Git is the default version control system for most people in software. It is easy to set up and simple to use:
This system works well if you have a few people working on a small project, but unfortunately it doesn't scale well. Here are some scenarios to demonstrate:
- Create a code repository with a main branch (used to be called master branch).
- To make a change to code, make the necessary edits to code. To make a "save point" of the current code, you create a commit with the edited code files. Once you've confirmed that the code works, you push to the branch.
- If the change you intend to make is large (for example, adding a fancy new feature), you can also create development branches to avoid breaking your project in the main branch. If something goes massively wrong with your new feature, you can start over easily.
- Many, many people editing code very frequently: When multiple people push edits to the same file to the same branch, merge conflicts will arise. Git provides little help with resolving merge conflicts.
Most people set up remote repositories (such as on Github). If someone wants to make a small change, they must have a local copy of the entire repository. If the repository is large, this is a waste of time and space. Avoiding this is possible with Git, but messy.
- Git simply refuses to work with large files. This is a problem if you need to store binaries/images/logs/etc.
Perforce has a steeper learning curve (possibly because it's harder to find a person who can help you learn it?), but it provides plenty of benefits over Git:
One of the main disadvantages to Perforce is that if you need to edit the same file for multiple changes, you would need multiple workspaces. This means that you will have multiple local copies of the same file (well, different once you edit them), which might take a long time to copy over if the files are large or if there are many files.
- Perforce's conflict resolution tool is fantastic. It is quite good at auto resolving, and it also gives you a diff when you need to manually resolve conflicts.
- Perforce branches are not the same as Git branches, and they are very sparingly used. This makes versioning a much more linear process.
- With Perforce, you can prepare multiple unrelated "commits" at the same time by using multiple changes within a workspace.
- Perforce has great integration with code review tools. This isn't technically required of a versioning control system, but it is neat to have!
- Since Perforce is a centralized system, it can lock a file so that no further changes to the file will be made.
- Perforce is excellent for storing/sharing large files. Also, since Perforce doesn't require the user to make a local copy of the entire project, this saves a lot of space.
- Perforce allows you to view a file in time-lapse mode, which is neat!
- You can see who else has checked out (is editing) a file that you are also working on.
The other disadvantage is that Perforce isn't free.
This isn't to say that we should always use Git. If you have a quick-and-dirty project to work on, Git is great.
I have not tried to use SVN or Mercurial much, so I can't comment much on them.