What the hell are Git and GitHub?

I’ve seen some really nice CI/CD pipelines with git. Are you using something like the git flow model?

2 Likes

Wasn’t it Granny Clampett that once said: “NOW GIT!”

1 Like

It’s actually pronounced “jithub.”

27 Likes

Other version control systems also do this but without all the sharp edges and with a somewhat shallower learning curve (largely due to the lack of sharp edges). For example mercurial.

Git is good in that it actually does distributed version control fairly well, but it is also bad in that it is less a “version control system” then a “version control system construction kit (that comes with a free example)”. I have to admit some of the sharp edges are great at getting you out of some very unhappy states…but at the same time you only really get into those states because of other sharp edges.

3 Likes

Yeah its my view that Git was Linus Torvalds name for Andrew Tridgell, though many will say Linus named it after himself.

edit: since we are providing definitions:

git is a mediocre version control system which became popular because it was promoted by the author of Linux
github is a hosting solution for git which creates more problems that it is worth, in my opinion.

I use both in my day job but by night I use mercurial and my own file server.

1 Like

Yeah. I must confess I wasn’t really clearly stating the issue there, so much as glibly throwing out a project management philosophy hand grenade.

The real issue I’ve been having is with keeping a separate fork from an upstream project, that simultaneous needs merges from the upstream, occasionally contributes back to the upstream, but also is on a totally divergent development path with frequent automatic builds, and all of the necessary git hooks to make commits do what they are supposed to when checked in. (I’ll leave the case of bridging between that and a project mostly developed in an svn environment off the table for now.)

It’s also wonderful if you code alone.

Sublime merge is amazing.

I have heard people at work recommend Think Like A Git to get the basics down without being overwhelmed. Also A Visual Git Reference visualizes what commands actually do.

You could also just install git on your laptop, you don’t need a server to use git.

Speaking of the PI, you could also install Gitlab, which is a lot like Github.

4 Likes

You absolutely don’t need a server for git if all you want is a version control system. If you want to actually check the code (or whatever you store in it) out on multiple systems then you start needing a server, or at least a laptop that hasn’t gone to sleep and is on the same network as the other stuff you want to do checkouts on. “Local only” is a valid use case, although at that point git is very much overkill and you could have used older non-distributed version control systems.

A git server normally needs exceptional little CPU power so a RPi can indeed handle it…but the “mass storage” on a RPi is normally a flimsy little SD card. So I would be a little worried about it diving without warning and taking all the git repositories with it. If you use an external USB hard disk or “real” SSD though it should be fine. Github would also be find if you don’t care if your repo is public (it is free to have a public GitHub repo, private ones cost a little money each month…like a bit under a third of the RPi’s cost a month), and provides off-site backup storage & makes it easy to get at from anywhere on the internet.

3 Likes

Ah well, git is not exactly rocket science. Would you really recommend people rather learn svn or even cvs, or even something proprietary? Would they even run on modern machines? :grinning:

If, for some strange reason you wouldn’t want to give your money to Microsoft (who own Github), you could use the free plan at Gitlab.com which gives you unlimited private projects.

2 Likes

Grumble grumble rocket surgery grumble grumble.

Ah-hem um, yeah, sure with all the tutorials and stuff it is probably not that much harder to learn git then something like subversion…as long as you stay away from all those sharp bits.

Well, sometimes I forget people didn’t learn them all when they were new and stuff on account of not being born or some other such flimsy excuse :wink:

Yeah, if you likely eventually need a distributed version control system it would be better to learn one now rather then learn say SVN which you will not run into very much as opposed to something you will actually run into and need later. Like I don’t recommend people learn to program with “learner languages” I recommend real languages that have an interpreter or an ultra-fast compile mode and some sort of repo or playground or other interactive-like environment.

Oh!!!

Ok, I may be migrating some repositories this weekend…

2 Likes

Oh my, that’s me for my first few attempts at git. Luckily I new a guy who was a wizard and usually was able to fix. Needs a lot of discipline and practice and repetition.

1 Like

The best knife in the kitchen is also the one that can take off the end of your finger.

I use ‘git’ for work. When it works it works well. I do not have a good mental model of how it works, as in the XKCD cartoon. When it doesn’t do what you expect, there is a good online community who have probably answered your question already. That is an important part of the whole product.

3 Likes

You, Sir, are in a ‘detached head’ state.

3 Likes

Somebody pushed him too far…

1 Like

As opposed to a Head of State with a detached head. Charles I.

2 Likes

If, for some strange reason you wouldn’t want to give your money to Microsoft (who own Github), you could use the free plan at Gitlab.com which gives you unlimited private projects.

I recently switched companies from one that uses Github to one that uses Gitlab; you get what you pay for. Gitlab is super slow and clunky compared to GitHub, and the latter has been on a tear in the past few months adding dozens of little quality of life improvements.

Are you on the free plan, or on a paid one? There appears to be lots of features only available in paid plans.

I just cloned an existing repo to gitlab.com, and it wasn’t that bad. But if your company insists on gitlab, maybe you could experiment with self-hosting the open source version of gitlab? Then you can simply throw more hardware at it.

Yeah, I mean, both companies I have worked for so far had their own self-hosted gitlab.

Yeah, I think part of our problem is that we do self-host. I’ve got a pretty sizable Merge Request open with 96 changes to dozens of files, and it takes several seconds to load.

Yeah, that sucks. Throw more hardware at it :wink: