Using Git with SolderPad
Getting up and running with Git
In order to push files to, or clone files from, a SolderPad project you will need to have the Git software installed on your computer.
Installing the software
If you're running GNU/Linux or BSD you should be able to install Git via your package manager or ports system. If you're running Windows or OS X you can download it from the Git website.
Once this is installed you will need to set up your global configuration:
git config --global user.name "Your Name"
git config --global user.email name@domain.tld
Documentation
There are plenty of great introductions to Git on the Web. For example:
- The official documentation
- The Pro Git book
- A step-by-step, hands-on guide: Git Immersion
- GitHub's Introduction To Git
- Git from the bottom-up: PDF
- The Git Magic book
- The Visual Git Guide
Cloning a project repository
The URI to use in a git clone operation can be found in the Files section of a project page. E.g.
git clone git://solderpad.com/solderpad/arduino-uno.git
Pushing files to SolderPad
Creating a new repository
Once you've added a project you can create a repository, add files files and push this to SolderPad.
Initialise a new repository:
mkdir projectname
cd projectname
git init
git remote add origin git@solderpad.com:username/projectname.git
Add files to the repository, commit changes and push to SolderPad:
cp project.* projectname/
cd projectname
git add -A
git commit -m "Initial commit"
git push origin master
Special files
The .solderpad directory in the root of a project's repository is where we store the photo, schematic and board images and bill of materials that are displayed on the project page.
When you create a new repository you will also need to create the .solderpad subdirectory and add the following files:
Description | Filename | Maximum size |
---|---|---|
Main photograph | photo.(jpg|png) | 5M |
Schematic diagram image | schematic.(jpg|png|pdf) | 5M |
Board image | board.(jpg|png|pdf) | 5M |
Bill of materials | bom.json | 1M |
If you are using the CadSoft Eagle EDA software there is a ULP script which will generate a correctly formatted bom.json from a schematic.
Note: you may experience a delay between the completion of a git push operation and schematic and board images being updated on a project page. The Recent activity section of the page will indicate when these have been processed and if there have been any problems.
Using an existing repository
If you have an existing Git repository you'd like to use you can simply define a new remote. E.g.:
git remote add solderpad git@solderpad.com:username/projectname.git
Then push to SolderPad with:
git push solderpad master
And still push to the other remote (if one was set up):
git push origin master
The name origin
is just the default name used for a remote when you clone a repository.
You can use this method to enable pushing a project repository to more than one remote location. Or you can use it to clone from one location initially, to then push to SolderPad thereafter.
Git problems
Prompted to enter git@solderpad.com's password
The most common cause for this is not having your SSH public key configured. Ensure that you have added this to your SolderPad profile.
To confirm that you have R/W access to a repository you can enter:
ssh git@solderpad.com info
Error: "fatal: The remote end hung up unexpectedly"
This error is received if you have cloned
the R/O Git URL rather than the R/W one. The latter will only be displayed on a project page if you are logged in and the owner of that project.
To display the URLs configured for remotes:
git remote -v
To update an incorrect URL:
git remote set-url origin git@solderpad.com:username/projectname.git
Assuming that the remote in question is called origin.