Git your PCBs online

Last time I showed you how to create a local Git repository around your PCB project. This alone provides you with local backups, helping you never lose the changes you make to your files and always be able to review your project's history as it develops.

However, an even more important part of Git's usefulness is the ability to upload our creations to one of the various online Git repository hosting services, and keep it up to date at all times with a single shell command. I'd love to show you how to upload your project to GitHub and GitLab, specifically!

to sum up

First, let's recap what goes into creating a repository. Here's a sequence of commands you can refer to - those commands were explained in the last article, so they're there in case you need a cheat sheet.

# identity configuration - these are public and can be fake git config --global user.name "John Doe" git config --global user.email johndoe@example.com # initialize a repository git init. git branch -M main # before your first commit, you add your .gitignore file # then add files if needed - use 'git status' to register git add board.kicad_pcb [...] git add README.md # or, given the correct .gitignore, you can simply do this: git add . # place your added changes in a commit git commits # an editor will open to write your commit message

What if you don't have a PCB project at hand? Here is a repository with a Jolly Wrencher SAO map that you can download as a .zip archive via the GitHub interface. It's already a repository - if you want to test these commands but don't have a PCB project at hand yet, you can freely push this repository to your own GitHub or GitLab account as a test exercise! If you want to start fresh and also practice the "creating the repository" part, just delete the .git directory in the root of the project.

What is the difference?

GitHub and GitLab both act as frontends for your repository. They also provide an additional place to dump your code - you can also just use a flash drive or a server with an SSH account. But hosting gives you a web interface where other people can take a look at your code and its README so they know if your code interests them, ask you questions, share their own code changes with you, download any additional related files (like gerbers) you may have downloaded and do a myriad of other useful things. You don't need to use any of these features - you can turn them all off, but they're there whenever you need them.

GitHub is the most well-known platform, and it was a pioneer in many ways. Much of the small-scale software and hardware piracy action takes place on GitHub, and many repositories you might be interested in contributing to will also be there. There are plenty of tutorials that work with GitHub, and fun tools like this command-line GitHub UI we've covered.

GitLab is a lesser-known but no less useful platform you can use for your code, PCBs, and docs, and it has some significant advantages over GitHub. First, the GitLab software itself is completely open-source, so you can self-host it, and many do. It's not the only self-hosted service, but it's one of the largest and most comprehensive. Just like WordPress being both a software suite and a platform, you don't have to self-host it. If you want a place to host your repositories, you can go to gitlab.com and create an account, just like people do with GitHub.

Git your PCBs online

Last time I showed you how to create a local Git repository around your PCB project. This alone provides you with local backups, helping you never lose the changes you make to your files and always be able to review your project's history as it develops.

However, an even more important part of Git's usefulness is the ability to upload our creations to one of the various online Git repository hosting services, and keep it up to date at all times with a single shell command. I'd love to show you how to upload your project to GitHub and GitLab, specifically!

to sum up

First, let's recap what goes into creating a repository. Here's a sequence of commands you can refer to - those commands were explained in the last article, so they're there in case you need a cheat sheet.

# identity configuration - these are public and can be fake git config --global user.name "John Doe" git config --global user.email johndoe@example.com # initialize a repository git init. git branch -M main # before your first commit, you add your .gitignore file # then add files if needed - use 'git status' to register git add board.kicad_pcb [...] git add README.md # or, given the correct .gitignore, you can simply do this: git add . # place your added changes in a commit git commits # an editor will open to write your commit message

What if you don't have a PCB project at hand? Here is a repository with a Jolly Wrencher SAO map that you can download as a .zip archive via the GitHub interface. It's already a repository - if you want to test these commands but don't have a PCB project at hand yet, you can freely push this repository to your own GitHub or GitLab account as a test exercise! If you want to start fresh and also practice the "creating the repository" part, just delete the .git directory in the root of the project.

What is the difference?

GitHub and GitLab both act as frontends for your repository. They also provide an additional place to dump your code - you can also just use a flash drive or a server with an SSH account. But hosting gives you a web interface where other people can take a look at your code and its README so they know if your code interests them, ask you questions, share their own code changes with you, download any additional related files (like gerbers) you may have downloaded and do a myriad of other useful things. You don't need to use any of these features - you can turn them all off, but they're there whenever you need them.

GitHub is the most well-known platform, and it was a pioneer in many ways. Much of the small-scale software and hardware piracy action takes place on GitHub, and many repositories you might be interested in contributing to will also be there. There are plenty of tutorials that work with GitHub, and fun tools like this command-line GitHub UI we've covered.

GitLab is a lesser-known but no less useful platform you can use for your code, PCBs, and docs, and it has some significant advantages over GitHub. First, the GitLab software itself is completely open-source, so you can self-host it, and many do. It's not the only self-hosted service, but it's one of the largest and most comprehensive. Just like WordPress being both a software suite and a platform, you don't have to self-host it. If you want a place to host your repositories, you can go to gitlab.com and create an account, just like people do with GitHub.

What's Your Reaction?

like

dislike

love

funny

angry

sad

wow