Question on (my) workflow migration svn -> git

Brandon Bergren bdragon at FreeBSD.org
Fri Sep 25 20:47:32 UTC 2020



On Fri, Sep 25, 2020, at 12:23 PM, Ulrich Spörlein wrote:
> Why not a bare repo same as with the svnsync copies before?
> 
> On each machine (doesn't matter if connected or not) he could:
> 
> git clone --bare https://.../{src,ports}
> 
> and "git fetch --all --prune" (or some combination) whenever internet
> connectivity exists. Then it's easy enough to clone from that local
> copy for the various branches, but it's obviously suboptimal. I
> recommend to read `man git-worktree`. From those bare repos, he could
> check out both stable/12 and head to some arbitrary location and keep
> them updated with ... um git pull I believe.
> 
> so for svn switch, look at a bare clone + multiple worktrees (if you
> need just a single worktree, then don't do the bare repo, obviously).
> 
> I also assume that your combination of svnsync + rsync was only due to
> speed, yes? You can ignore all that and always pull directly from the
> cgit.freebsd.org host or whatever the final URL will be. The savings
> in bandwidth are not worth it to do something else, but you can of
> course `git remote add ...` on your laptop and fetch first from the
> local clone and then from the internet.
> 
> In short, the svnsync crutch is no longer needed, git can do that all
> natively and will be so much faster doing it, to boot. But, you'll
> need to read up on clones, fetches, bare repos, worktrees and other
> stuff.

And actually, you can pull from or push to a *regular* clone as well, as long as you are pushing to branches other than the currently-checked out branch. (Git will prevent you from pushing to the checked-out branch to prevent the working copy from getting desynced.)

-- 
  Brandon Bergren
  bdragon at FreeBSD.org


More information about the freebsd-git mailing list