Connecting to Git?

gtfields13

Well-known member
I have been completely frustrated in my attempt to use Github as version control for KiCad projects. I am using KiCad 9, and Mac (Tahoe). What I don't understand is how to overcome errors when I attempt to add a project to version control. If I use username and password, I can get to a point where I can Commit Files, but if I try Pull I get an error :"Could not connect to remote 'origin': remote authentication required but no callback set"

If anyone is willing to help, I would appreciate some pointer in how I am supposed to connect. I haven't found any online help that matches what I see in the app, or what happens. There is always the step, not shown, that I can't see how to execute...
 
For what it's worth, I've been completely unable to add new projects via the KiCad UI.

I have gotten it working by making the initial commit from the command line -- once I do that, I've been able to
use the KiCad UI. I think if you get the command line tools working without authentication, the
integration in KiCad should work for you.
 
For what it's worth, I've been completely unable to add new projects via the KiCad UI.

I have gotten it working by making the initial commit from the command line -- once I do that, I've been able to
use the KiCad UI. I think if you get the command line tools working without authentication, the
integration in KiCad should work for you.
I will try this when I have a moment. I've used command line/shell for Git, , so I guess I'll figure that out first :) I know enough on shells to be dangerous, but not much more (although I am old enough to have worked with Unix shells before there was anything but a command line)
 
Use git from terminal for version control.
Go to your project folder and type "git init".
Configure a new repository on github.
Then update remote URL for your repo.
Code:
git remote add origin REMOTE-URL
git push -u origin main
For first push/pull it will ask you for credentials.

Or, github has a nice UI application(Github Desktop) that you can use for version control.
Works great and very easy to work with.
Sometimes IDE's, or in your case, Kicad can be PITA for version control.
 
Your frustration is warranted. Git is not user-friendly. But git is nearly ubiquitous in the software development industry, so we just learn it.

I think for someone who wants to use it for kicad and wouldn’t be using it otherwise, something like Github Desktop would be a good choice. If you’re just starting and feel like your git project is too messed up, you can start over fresh by deleting the .git/ folder at the project root.

If you can learn kicad, you can learn git. But if you get to a point of frustration where you’re done with it, you could go old-school and save your project with a version in the name. my-project-v1, my-project-v2, etc.

And if your goal is to share on github, you can zip up your versions and add them to the “releases” section of your github project. You don’t get diffs between commits, but virtually no one will care. The ones that do will know how to pull up two different releases in a diff tool.
 
I downloaded it for the sole purpose of downloading project files for pcbs I have but it just downloads a zip file which I can’t open. Granted this is on a cellphone…but it’s also on the app so what’s the purpose of the app?
 
Thanks to @z2amiller @fetsenior @jcpst for helpful direction.
Once I committed to dealing via shell first, Git has very clear Mac directions on how to establish local clones which I was able to stumble through. Especially since I have slightly complicated my flow by using SSH.

At the end of the day, I can setup new repositories in desktop and once established, I could verify connection in the Github Desktop, and KiCad sees them and works fine. The two repositories that I had been stumbling with were more resistant (i.e. still won't authenticate) but I am guessing there is some erroneous first-attempt cruft in their version control / git that is interfering. Given that it's only two projects, it's easy enough for me to save the files locally, wipe the repositories, and create anew in a way that works.
 
I have a little script to push a new effects directory --
requires:
* 'gh' command line tool to make repos on github from the command line
* A .gitignore file somewhere (I copy direct from my home directory, you may want to copy from somewhere else)
* Ideally, git / gh commands configured to work without prompting for auth (but it should at least work if it does)

If you're pointing this at directories that already exist, you can remove the mkdir, and you might want to add a
'git add *' to add the project files that are already in the directory.


Bash:
DIR=~/Documents/repos
SRC=${1}
REPO="${1}"
RPATH=${DIR}/${REPO}
mkdir $RPATH
echo "# ${REPO}" > $RPATH/README.md
cp ~/.gitignore $RPATH/.
cd $RPATH
gh repo create $REPO --private
git init
git add README.md
git add .gitignore
git commit -m "initial commit"
git branch -M main
git remote add origin https://github.com/z2amiller/${REPO}
git push -u origin main
 
Back
Top