Solved Help set up a git repo

Discussion: I'm trying to set up my own git repo. I installed devel/git from ports. This is the stuff from https://git-scm.com, not github or gitlab. I started out by following the Examples section from here:
That part went OK. Trouble started when I started trying to publish my repo based on instructions from here:
Doing this:
Code:
# cd /usr/local/www/git/freebsd_kde
 # git clone --bare freebsd_kde freebsd_kde.git
fatal: repository 'freebsd_kde' does not exist

Against this backdrop, my question is: how do I rename the git repo? A Google search proved surprisingly unhelpful - I'd get answers related to github/gitlab web settings, out-of-date Stack Overflow hits (like from 2010), point-and-click in Eclipse and Visual Studio, etc. Even the search function on https://git-scm.com did not turn up useful info... Or am I missing something?
 
Tried this:
Code:
# cd /usr/local/www/git/freebsd_kde
# git clone --bare ../freebsd_kde freebsd_kde.git
Cloning into bare repository 'freebsd_kde.git'...
done.

Man, I was unable to find any solid info that repo name (as opposed to branch name) is just the name of the top-level folder where all the code/content lives. Just some hints about that, even in the official documentation... 😩
 
Wording nitpick: Working with GIT, you always have a repo, that's how these distributed systems work ;)

Your interest was a bare repo (which is one that doesn't have a working copy attached). Its advantage is that you can git push to it without worries :)
 
astyle yeah well, it might help to have the same understanding for sure, but what you wanted was kind of obvious from your text.

Although, I'm asking myself: Do you want to somehow "host" this bare repo via http(s) with some web-frontend? Cause then, you have different options. To name just two common ones:

devel/cgit: Not much more than browsing the repo, fast and lightweight
www/gitea: github-like features, e.g. "pull-requests" with reviews, issues, ...
 
Actually, this is for Poudriere... I want to set up a 'remote' git repo that gets specified in poudriere.conf in the GIT_PORTSURL, as in GIT_PORTSURL=git.beastie.localdomain/freebsd_kde/ports.git... 😅
 
I'm pretty sure poudriere would only ever clone/pull from that repo, so it doesn't have to be a "bare" one. You could just put your original repo there :)

edit: maybe, depending on what you want to achieve, my "nitpick" was actually useful then. There is no "working copy" with GIT that isn't also a repo. I personally just use a local repo's path for ports with poudriere and have my changes in a local branch there, that's IMHO the easiest way, but yes, I don't exactly know what you're trying to achieve.
 
I think I may have figured out the answer to Opening Post (just use $repo_root_dir_name) instead of a non-existent repo_name) to make a bare clone... but now there's a different issue: Git doesn't like self-signed certs!
Code:
# poudriere ports -c -m git -M /usr/ports -p freebsd_kde -U https://git.beastie.localdomain/freebsd_kde/ports.git
[00:00:00] Creating freebsd_kde fs at /usr/ports... done
[00:00:00] Cloning the ports tree...fatal: unable to access 'https://git.beastie.localdomain/freebsd_kde/ports.git/': SSL certificate problem: self signed certificate
[00:00:00] Error:  fail
[00:00:00] Error while creating ports tree, cleaning up.
This looks like a Poudriere problem, but it's not, it's a git problem. I got the exact same complaint from Git Gui on my Windows machine. Any ideas on how to fix THAT on a FreeBSD machine? Thanks!
 
Either use a public signed certificate (letsencrypt for example) or add your certificate to the trustet certificates (a symlink named as the short hash of the certificate in /etc/ssl/certs) on the poudriere machine.

It's also possible to configure git to skip any certificate check, but that kind of renders TLS useless...
 
Ahh, got git unstuck with this:
# poudriere ports -c -m git+file -M /usr/ports -p freebsd_kde -U /usr/local/poudriere/ports/freebsd_kde/. Poudriere warned me to use file:// instead of local filepath, but that still worked. And, the nice thing is that I'm not locked into this, I can actually come back later and resolve the cert situation and add the http repo URL to the whole enchilada, as well. So, I'm marking this solved. 😁
 
Back
Top