Git or Mercurial for Embedded Development - Page 1
Forum section: electronics / general

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: December 10, 2015, 05:17:17 pm
content: I want to upgrade from CVS to a modern version control system. I've narrowed my choices down to two: Git and Mercurial.I'm a hobby embedded developer and don't collaborate with others on projects. I want a distributed version control system rather an a centralized one (like Subversion) because I develop on multiple machines from multiple places and would like to use github or bitbucket to host my repositories so I don't have to set up and maintain my own server.For a single developer, which one of these would be the best choice? Since I only work on my own projects, I don't have any need for complex merging of other people's code.I do all of my development on Windows, and am comfortable with both command line tools and GUI tools and use both interchangeably.

author: Monkeh
author_rank: Super Contributor
timestamp: December 10, 2015, 05:24:50 pm
content: git. It's a well proven tool in large scale use.I have seen a number of projects abandon Mercurial.

author: hamster_nz
author_rank: Super Contributor
timestamp: December 10, 2015, 05:25:52 pm
content: Quote from: Sal Ammoniac on December 10, 2015, 05:17:17 pmI've used Git For Windows and add TortoiseGit (https://tortoisegit.org/) for shell integration (i.e lots of options on Windows Explorer's right-click menu). Works pretty well for me.

author: dferyance
author_rank: Regular Contributor
timestamp: December 10, 2015, 05:26:31 pm
content: You will get different answers from different people. I have used both. My feelings are that mercurial is simpler and easier to use. So that would be my personal first choice. Git seems to becoming more popular though so having more integrations available may be a plus.Between the two, I don't think you will regret either. Flip a coin or something.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: December 10, 2015, 05:42:23 pm
content: Quote from: blueskull on December 10, 2015, 05:33:08 pmI use Rowley CrossWorks for ARM. It does support version control systems, but I prefer to do all version control related stuff outside the IDE as that better suites the way I work.I've looked at GUI clients and SmartGit supports both Git and Mercurial and is free, so I'll probably use that for a GUI.Is one or the other VCSs better at maintaining the integrity of a repository? I put a lot of time into my code and I'm therefore somewhat paranoid about losing something if something goes sideways.

author: Stupid Beard
author_rank: Regular Contributor
timestamp: December 10, 2015, 06:09:37 pm
content: Quote from: Sal Ammoniac on December 10, 2015, 05:42:23 pmI prefer SourceTree on Windows and OS X, but I use SmartGit on Linux. SourceTree is generally better once you have it setup to your liking; the default setup is kind of retarded these days.Quote from: Sal Ammoniac on December 10, 2015, 05:42:23 pmI have used lots of different VCSs over the years, and the only one that springs to mind as one that will screw up your repo isVisual SourceUnsafe. Fortunately that heap of shit has gone the way of the do-do nowadays.Regarding the original question, Git and Mercury work in a similar manner. I would suggest trying both of them out on a real project and see which you prefer.

author: jmag999
author_rank: Contributor
timestamp: December 10, 2015, 06:32:35 pm
content: I like Sourcetree as well. It made it easier to switch to GIT from SVN. The built-in diff is nice too.

author: Scrts
author_rank: Frequent Contributor
timestamp: December 10, 2015, 07:31:43 pm
content: I've used SVN most of the time, then I had to use Serena, but for personal stuff I vote for GIT. I've tried Mercurial, but somehow it was easier to go for GIT, because I was able to find help more easily.

author: rich
author_rank: Frequent Contributor
timestamp: December 10, 2015, 09:03:32 pm
content: +1 for Git.Technically either will be just fine for your needs and both have tool support but Git feels like it's becoming the de facto standard for IDEs and cloud based repositories.Sure my opinion is subjective and based on many years professional dev experience but google trends at least helps enforce my confirmation bias:https://www.google.co.uk/trends/explore#q=Git%20version%20control%2C%20mercurial%20version%20control&cmpt=q&tz=Etc%2FGMTDo you use open source libraries or experiment with code examples? If so where/how are these hosted as that may influence your decision? Much easier to grab code with a VCS tool than to click a 'download zip' link.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: December 10, 2015, 09:41:52 pm
content: Quote from: rich on December 10, 2015, 09:03:32 pmMaybe that's reason to use Mercurial. We Americans like the underdog.QuoteNope. I write my own code and don't use libraries or examples. One thing I do frequently, however, is create a temporary copy of my code to try something new, which I then merge back into the mainline code if it works out.

author: rich
author_rank: Frequent Contributor
timestamp: December 11, 2015, 12:13:40 am
content: Quote from: Sal Ammoniac on December 10, 2015, 09:41:52 pmI can't argue with that logic - I've backed some of those along the way too

author: legacy
author_rank: Super Contributor
timestamp: December 11, 2015, 12:56:27 pm
content: Mercurial: pros && cons ?(latin form, I do not know the right English formPROs=good reasons to use itCONs=good reasons to avoid it)

author: legacy
author_rank: Super Contributor
timestamp: December 11, 2015, 12:59:27 pm
content: I am using gitPRO: cause I have to follow the linux kernel development (especially for MIPS), and those guys have decided to use git for all their reposCON: my list_CON[]={} is empty, however I have no experience with SubVersion and Mercurial

author: legacy
author_rank: Super Contributor
timestamp: December 11, 2015, 01:06:54 pm
content: Quote from: Sal Ammoniac on December 10, 2015, 09:41:52 pmMy urban dictionary says that an "underdog" is a person or group in a competition, usually in sports and creative works, who is popularly expected to lose.so the question is: actually, why do you use? (do I miss something ?)Correct me if I am wrong with the above term meaning, I am not American, in my wishes: to understand and learn slang and urban dictionaries.

author: nfmax
author_rank: Super Contributor
timestamp: December 11, 2015, 01:10:17 pm
content: Quote from: legacy on December 11, 2015, 01:06:54 pmIn days of yore, men (it was always men) had to saw up very large logs by hand, as there was no other way. Because very large logs are very heavy, rather than lift the log onto trestles, they used to drag it over a hole in the ground - a sawpit - where they wanted to cut it. Then two men would take one end each of a very long saw, and push & pull it between them. One stood on top of the log, or on a stand, the other was down in the sawpit. These positions were called 'top dog' and 'underdog'...

author: gmb42
author_rank: Frequent Contributor
timestamp: December 11, 2015, 01:25:29 pm
content: While git is what the cool kids use, for someone with cvs experience you will suffer at the start with the different vcs model, so you may still want to consider svn. Mecurial tries to take the svn model and apply it in a dvcs fashion but seemed to me to fall between the two stools.IME all git newbies will trash their local repo at some time, and then make things worse trying to fix it with all the random websites offering recipes with all the many different git commands and options. This is especially painful if you haven't pushed your only copy of work to another (hosted) repo for a backup. git encourages a "keep work local" model with very handy local branches, whereas svn branches are a central server equivalent that require a little more effort to switch your working copy between but a somewhat harder to inadvertently destroy.There are plenty of folks that host svn servers, some for free, so I don't see that as a differentiator.If your mind isn't made up yet, I would suggest svn first, then if you don't like it, or need more, a migration to git is possible, whereas going in the other direction is a lot more difficult.

author: Monkeh
author_rank: Super Contributor
timestamp: December 11, 2015, 01:59:14 pm
content: Quote from: legacy on December 11, 2015, 12:59:27 pmIt was written specifically for the task, actually.

author: savril
author_rank: Regular Contributor
timestamp: December 11, 2015, 03:08:14 pm
content: Quote from: gmb42 on December 11, 2015, 01:25:29 pmI don't understand why you think Mercurial is like the svn model. Mercurial is truly a DVCS with a local repo and push/pull fashion with cheap branching. For me git and Mercurial are on par with the DVCS model.A few years ago for a IT contract as an architect, I choose Mercurial for VCS because it was way simpler to use, and developers were not accustomed with DVCS. Git as a lot of functions that few will use. The terms used for the commands are somewhat disturbing. The flow is more complicated (stash, commit). The number of users is way beyond git (1/10 I would guess).But git has more users and most OS projects use it. It was built to manage the Linux kernel source, so it can manage very large repositories. Github is also a major reason to use git, not because of Github but because a lot of people use it and it facilitate the job when you contribute patches to an OS project. But to use it, I have to keep a git manual at hand to remember some functions I use only sometimes. You will also crash a least one time a repository because you will have wrongly used a dodgy command. I really don't like the CL UI.I like Mercurial more than git because its flow and syntax is way more intuitive than git. And I like its code better as it is written in Python than in C for git, it give it a possibility for more extensions.But if I would have to choose a DVCS for a company, I would go for git as it is really more widely used. Git has integrations in all the (not outdated) tools, like Subversion or CVS. When working with other people (contractants, open source contributors, ...), you are most likely to find people who already know git than mercurial.Git is now the de-facto standard.But in your case as you don't work with others, I would choose on :- how much the tools you use have integrations with git- how important is the community support for you, as Mercurial has less users

author: gmb42
author_rank: Frequent Contributor
timestamp: December 11, 2015, 03:27:14 pm
content: Quote from: savril on December 11, 2015, 03:08:14 pmI mistyped, I meant that Mercurial commands are similar to svn commands, which are somewhat similar to cvs. Thus Mercurial commands look at first glance to be the same as svn, but of course they're working on a dvcs repo so "unexpected" things can happen.I always see "cheap branches" quoted as a pro for git. Svn branches are also cheap, although a bit more wordy "svn cp path/to/repo/trunk /path/to/repo/branches/mybranch -m "Your commit message here", and all the action happens on the central repo where a shallow copy is made.What is more "expensive" with svn is switching between branches, as all the differences between your current wc location in the repo and the new branch have to be pulled from the central repo. With git, this all happens locally in your repo as git trades local disk space for bandwidth to the central svn server.

author: nctnico
author_rank: Super Contributor
timestamp: December 11, 2015, 03:46:11 pm
content: I like to use version control from the Eclipse IDE because it is well integrated. It is very helpful to be able to see the difference between a previous / trial version and the current code or to just look at the differences between 2 versions. Copying & pasting between actual code and old code is also very easy.

author: zapta
author_rank: Super Contributor
timestamp: December 11, 2015, 04:06:58 pm
content: Git has very non intuitive command set but is the de facto standard. Practically you need to remember only very few commands and search the web for occasional more complex use cases.

author: Cerebus
author_rank: Super Contributor
timestamp: December 11, 2015, 04:22:42 pm
content: My 2 pence worth.Over the years I've used most of the various standard version control systems from SCCS onward. In a toss-up between git and Mercurial I'd opt for Mercurial every time. The everyday things you need to do with a version control system seem a lot easier and more straightforward to achieve with Mercurial - git always seems to need an option added to the command line for even the most straightforward of tasks.In terms of absolute capabilites they are about equal; it's just in my experience that Mercurial doesn't get in the way of getting the task done.

author: Karel
author_rank: Super Contributor
timestamp: December 11, 2015, 04:32:24 pm
content: Quote from: blueskull on December 10, 2015, 05:33:08 pmThat depends on which software you use for schematic design. EDA software that uses textbased/XML formatting for their design files go very well with git.

author: westfw
author_rank: Super Contributor
timestamp: December 11, 2015, 06:41:17 pm
content: Nice "class" on GIT (and on vcs in general. People already familiar with some vcs may find it a bit slow):https://www.udacity.com/course/how-to-use-git-and-github--ud775

author: magetoo
author_rank: Frequent Contributor
timestamp: December 14, 2015, 07:21:38 am
content: I'm using Mercurial for some personal projects, mainly because there was agood tutorialfor it. Git, anecdotally, seems much harder to learn and to really understand. (In my small sample size of friends, the process of learning seems to be typing "how to X in git" into a search engine and trying suggestions until something works.) Not such a big deal once you're up and running though.Fossilcould be worth investigating too. Pros: One small binary does everything, repos are single files, integrated wiki and web support. Cons: Small user base, the idea of a "fossil record" might not be the right one for everyone.

author: miguelvp
author_rank: Super Contributor
timestamp: December 14, 2015, 07:30:31 am
content: About a year ago Perforce offered free 20 seats so that's what I'm using.Seems they have extended that to their new Perforce Helix, but I have not tried it.https://www.perforce.com/downloads/helixDon't know what extra features Helix has, I know their older Perforce integrates well with Visual Studio, even with the Free Community edition.

author: ivaylo
author_rank: Frequent Contributor
timestamp: December 14, 2015, 07:56:18 am
content: For a single developer who isn't sharing code this discussion is pointless. Git vs. svn vs. hg vs. cvs for a single guy, really?

author: miguelvp
author_rank: Super Contributor
timestamp: December 14, 2015, 08:28:20 am
content: Quote from: ivaylo on December 14, 2015, 07:56:18 amNot pointless. Even for one user being able to revert a changelist is a good thing. Or even branch from an old version to try new things.Also, and of course this doesn't happen to me, code review some revision when I had too much wine. I do swear, I never commit in that stateWhy distributed? one machine can bite the bucket so you are not out of the full repository. Especially since we tend to plug projects into the USB port (haven't fried one... yet).

author: con-f-use
author_rank: Unknown
timestamp: December 14, 2015, 08:40:11 am
content: Themost annoying cons of Gitlisted in a humorous way.

author: nctnico
author_rank: Super Contributor
timestamp: December 14, 2015, 09:01:38 am
content: Quote from: ivaylo on December 14, 2015, 07:56:18 amI'm usually in such a situation. It is very benificial because a version control system allows to keep old versions. When writing software nothing is more important than being able to support older (mature) versions of software. It is also handy to distribute code over more than one machine. For example: sometimes I use my laptop and change some code on-site. Back in the office I commit these changes into SVN and check them out on my primary PC.I once worked at a company where a programmer for a large software product didn't keep the source of software which was installed in the field. So everytime a customer complained about a bug he couldn't provide a quick fix. In his view the customers had to wait for the new stable release with new (and buggy) features. The customers wheren't happy and it did cost the company a lot of money. It took the rest of us an tremendous amount of effort to get him to use a version control system and even then he managed to delete sourcecode for a version which was 'in the field'. If it wasn't such a friendly guy I'd almost start to think he was sabotaging the company on purpose.

author: rich
author_rank: Frequent Contributor
timestamp: December 14, 2015, 04:19:33 pm
content: I agree. Over analysing the smaller differences between git, hg etc might be pointless for a solo developer but using a version control system still has many advantages over not using one. In this case the OP already uses CVS and wants to move to a Mercurial or Git.Quote from: miguelvp on December 14, 2015, 08:28:20 amI'd say that is one advantage of DVCS. Continuing to work unhindered without network access is high up my list of advantages when travelling, or on a local subset of machines at alternate locations. For most of my solo work I push to Github to give me an internet accessible offsite backup, so I sort of treat it more like a centralised system in that respect.

author: milkop
author_rank: Newbie
timestamp: December 15, 2015, 05:41:49 am
content: I use Git at work and it's very powerful and encourages branching by making switching back and forth really quick. If you're comfortable on a command line or have a decent gui or ide integration, it's not too hard to learn, though I still have to look up commands and resolutions as it can be enigmatic. The documentation is good though and, given its origins, it's probably not going anywhere soon. You're smart to be using source control even as a solo developer because disk space is cheap and the undo buffer is finite.

author: ivaylo
author_rank: Frequent Contributor
timestamp: December 15, 2015, 09:40:57 am
content: Quote from: nctnico on December 14, 2015, 09:01:38 amAbsolutely. You do need A version control system, but if you are alone it doesn't really matter which one you pick. For one guy all mentioned are kinda the same. You want distributed? Just share a drive...

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: December 15, 2015, 10:12:05 am
content: Quote from: con-f-use on December 14, 2015, 08:40:11 am^ That's consistent with my experience of Git.BTW I use svn, works fine with the Tortoise wrapper, though I would/should one day change to git and learn the ways but until there is a need... I can't be bothered.

author: Jeroen3
author_rank: Super Contributor
timestamp: December 15, 2015, 10:51:21 am
content: Quote from: nctnico on December 14, 2015, 09:01:38 amThat's very hard to do with git. You'd have to purposely remove blobs on the remote repository. And when you're poking on the remote you know you need to create a backup.A major drawback of all of the above named version control systems is that they hide themselves in the local repository.Meaning that anyone not familiar with it, or with disabled hidden folders, does not notice the .svn, .git or .hg and might even remove accidentally. As do some automated cleanup stuff or sync tools. Highly annoying.

author: zapta
author_rank: Super Contributor
timestamp: December 15, 2015, 03:05:15 pm
content: Quote from: miguelvp on December 14, 2015, 07:30:31 amPerforce is the most intuitive and easy to use version control system I ever used. I am not sure though if it has a hosted service or works offline as git does.

author: Dielectric
author_rank: Regular Contributor
timestamp: December 15, 2015, 05:47:17 pm
content: Quote from: con-f-use on December 14, 2015, 08:40:11 am...and that's why I installed SourceTree.

author: Karel
author_rank: Super Contributor
timestamp: December 15, 2015, 06:32:31 pm
content: Quote from: Dielectric on December 15, 2015, 05:47:17 pmIs it better than Gitk?

author: Dielectric
author_rank: Regular Contributor
timestamp: December 15, 2015, 08:37:44 pm
content: Quote from: Karel on December 15, 2015, 06:32:31 pmDifferent, I haven't used gitk but it looks like a commandline wrapper, right? SourceTree is a visual interface to git; I do about 99% of my development under Windows because of the rest of my toolchain, so it fits into that paradigm pretty well. You still need to know what Git does and how, but my brain is full and I don't feel like learning more command line syntax so clicky-draggy is nice.