Hey

So a couple of weeks ago I received an email asking how to go about setting up a Git server on Linux. This is actually pretty straight forward, provided you are familiar with Linux. I made a quick video describing the process.

In this video we end up accessing the repository on the server through SSH. There are alternatives to this, such as WebDav, or the built in Git protocol. However, everything I have ever worked on has used SSH to access the repository. It’s also how GitHub does it.

The basic steps:

  1. Connect to the server
  2. Make sure that all your developers have a user account on the server (adduser)
  3. Create a group on the system for your developers (addgroup)
  4. Add all the developers to that group. I did this by manually editing /etc/group on the server, but the more correct way would be to use the useradd command. That way you are less likely to mess up the group file.
  5. Create a directory in which to put the git repository.
  6. Set the group ownership to the group you just created (chgrp)
  7. Make the directory group read/writable, with the sticky bit set so subdirectories inherit the group permissions (chmod)
  8. Initialise a bare, shared repository
  9. ????
  10. Profit!

Hope that helps a bit!

Join the conversation!

Hit me up on Twitter or send me an email.

In the last video, we just looked at adding files and commiting changes. This is great, but remember that in Git, commits are local. In this video we look at how we can set up remote repositories that we can push data to, either to use as backups, or for sharing with others.

Notes

I cannot believe I messed up the remote path that many times! I am sorry about that. Of course, the side effect is you learnt how to both add and remove remotes. So yeah… I did that on purpose.

At this point, we can create a project or join an existing one. We can add files and commit changes. We can push our changes to remotes, and fetch changes that other people have made. This is all great. However, we haven’t touched on one of Git’s most powerful features. I am of course talking about branching and merging. This will be the priority for the next video.

Again, any feedback is much appreciated.

Join the conversation!

Hit me up on Twitter or send me an email.

This video hits up the terminal and starts using git. We start by creating a git repository, which is super easy with Git. Then, we look at adding files to the repository, and commiting changes.

Notes

In this video, I specifically create a project using:

git init

. If you are working on your own projects, this is how you will work. However, a lot of the time you will be starting work on an already existing project. In this case, you don’t create a new repo using git init, instead you clone an already existing repository. The basic is this:

git clone path/to/repository

I will cover this in a later video, but I think it is important enough to mention here.

Another thing that I could have covered in more detail is the staging area. There is actually a lot more that you can do with it than I mentioned in this video. However, that will come later. For the first 3 videos (at least) I want to just get the basics down.

Join the conversation!

Hit me up on Twitter or send me an email.

In this episode I give a brief introduction to the Git Version Control System.

Notes

Git is a distributed version control system, originally written by Linus Torvalds for Linux Kernel development. It is Free and Open Source software. You can get it for Linux, Mac and Windows (either native or cygwin). There are also plugins for Eclipse, etc, so you don’t have to work from a terminal like me.

This video just tries to convey what makes working with a distributed version control system different and better. Nothing too strenuous just yet. If you are a Git guru, I am aware that I am glossing over some details in this video. This is intentional, and I hope to cover some of these details in later videos, or at least in the accompanying text. Still, I welcome any and all feedback and suggestions.

Also, I apologise in advanced for my terrible tablet handwriting skills.

Join the conversation!

Hit me up on Twitter or send me an email.