News for hackers. Stuff that matters.
Re:Tell HN: GitHub will delete your private repo if you lose... by zxcvbn4038 on Tuesday January 31, 2023 @04:09PM (#34602145)
I have a number of git repos that the original developers deleted - because I sync’d them to a usb stick with gitea. I think that is how you have to do it - never entrust a service, especially a free one, with your only copy of anything you value.

If the YouTube algorithm nukes your account and all your videos, you should be ready to upload them to a new account. Same with anything else digital.

My current is standard is one copy in AWS S3 which is super reliable but too pricy for daily use, and one copy in Cloudflare R2 or Backblaze B2 which might or might not be reliable (time will tell) but is hella cheap for daily use.

Re:Tell HN: GitHub will delete your private repo if you lose... by no_butterscotch on Tuesday January 31, 2023 @04:12PM (#34602195)
> If the YouTube algorithm nukes your account and all your videos, you should be ready to upload them to a new account. Same with anything else digital.

Do you know if this is a common occurrence?

Also, I'm only a YouTube viewer and am not familiar with all the creator tools, problems, communities, etc. But would a creator really re-upload all their back-catalog if deleted? Just to try to get back to views and things?

Re:Tell HN: GitHub will delete your private repo if you lose... by ChrisMarshallNY on Tuesday January 31, 2023 @04:26PM (#34602417)
I remember someone posting an agonized screed, some time ago, about YT deleting their channel, and all the videos.

Apparently, they had not kept the source/rendered originals of the videos, so it actually clobbered their business.

I am a scarred, limping old coot, and have learned [the hard way] that backups are goooood.

Re:Tell HN: GitHub will delete your private repo if you lose... by tomcam on Tuesday January 31, 2023 @06:51PM (#34604125)
> I am a scarred, limping old coot

That is a delightfully evocative phrase

Re:Tell HN: GitHub will delete your private repo if you lose... by tpxl on Tuesday January 31, 2023 @04:29PM (#34602465)
A few weeks ago, youtube changed their swearword policy. A creator I follow basically had to delete half their channel or risk termination.
Re:Tell HN: GitHub will delete your private repo if you lose... by patmcc on Tuesday January 31, 2023 @06:16PM (#34603770)
They're not banning channels based on swearwords (yet, anyway). They are demonetizing videos with swearing - in the first bit, if too much, maybe other rules, but nobody is getting banned from saying 'shit'.
Re:Tell HN: GitHub will delete your private repo if you lose... by Marsymars on Tuesday January 31, 2023 @07:25PM (#34604449)
If you don't want monetization, is swearing in your videos to avoid your subscribers having to watch ads a viable strategy?

(To get around this: https://www.forbes.com/sites/johnkoetsier/2020/11/18/youtube...)

Re:Tell HN: GitHub will delete your private repo if you lose... by zxcvbn4038 on Tuesday January 31, 2023 @07:33PM (#34604528)
Battlestar Galactica did it right - https://www.youtube.com/watch?v=rrYdQnz8vJg
Re:Tell HN: GitHub will delete your private repo if you lose... by mgdlbp on Tuesday January 31, 2023 @08:22PM (#34605018)
Huh, I was down a yt rabbit hole right around then when some videos suddenly wouldn't load, turned out that I might've been the last-ever viewer of the (small) channel that got banned right at that moment - did make quite an impression. A ban wave might explain that -- I was wondering just how often channels really are being banned that I'd see it happening in real time.
Re:Tell HN: GitHub will delete your private repo if you lose... by MonkeyMalarky on Tuesday January 31, 2023 @05:12PM (#34603014)
There were a whole bunch of artist and genre specific mixes I used to listen to on yt that are gone now. The uploaders accounts have all been nuked too. The sad thing is I can listen to it all on Spotify but it's not the same.. the creator's did not insignificant work to mix the songs together.
Re:Tell HN: GitHub will delete your private repo if you lose... by chipsa on Tuesday January 31, 2023 @06:13PM (#34603732)
Maybe not on YouTube, but the gunTubers are having issues with YouTube changing their interpretation of the rules and instantly issuing 3 strikes against them for rule violations. And so, it'd be good to have a back catalog to upload to a different service to keep that older material available.
Re:Tell HN: GitHub will delete your private repo if you lose... by sidewndr46 on Tuesday January 31, 2023 @04:47PM (#34602730)
I'm reasonably certain that if YouTube deletes your account uploading them to a new account is expressly forbidden.
Re:Tell HN: GitHub will delete your private repo if you lose... by j45 on Tuesday January 31, 2023 @05:20PM (#34603133)
I’ve read having a secondary test account to post videos under to pass YouTube scans before posting to the real account helps minimize issues.
Re:Tell HN: GitHub will delete your private repo if you lose... by Gordonjcp on Tuesday January 31, 2023 @04:50PM (#34602759)
How exactly can they stop you?
Re:Tell HN: GitHub will delete your private repo if you lose... by yunohn on Tuesday January 31, 2023 @04:52PM (#34602786)
What do you mean? They have extensive content ID/checks.
Re:Tell HN: GitHub will delete your private repo if you lose... by Gordonjcp on Tuesday January 31, 2023 @05:12PM (#34603015)
Post it somewhere else. Youtube is largely a waste of time, unless you're some right-wing idiot scamming money out of teenagers.
Re:Tell HN: GitHub will delete your private repo if you lose... by wjdp on Tuesday January 31, 2023 @04:54PM (#34602821)
For this I have a NAS with a pretty basic script that runs nightly to clone any new repos I have and update those already backed up. They get organised into a directory structure mirroring that of Github: `./github.com/user/repo`

If of any use to anyone else: https://gist.github.com/wjdp/a20cb15f76b651124b3b27cde06d121...

Re:Tell HN: GitHub will delete your private repo if you lose... by capableweb on Tuesday January 31, 2023 @04:57PM (#34602850)
> because I sync’d them to a usb stick with gitea

Just a tip: no need to use gitea if you want to replicate a git repository to somewhere else on disk/other disk.

Just do something like this:

    mkdir /media/run/usb-drive/my-backup-repo
    (cd /media/run/usb-drive/my-backup-repo && git init)
    git remote add backup /media/run/usb-drive/my-backup-repo
    git push backup master
And now you have a new repository at /media/run/usb-drive/my-backup-repo with a master branch :) It's just a normal git repository, that you also can push to over just the filesystem
Re:Tell HN: GitHub will delete your private repo if you lose... by josephg on Tuesday January 31, 2023 @05:21PM (#34603139)
Even better with

    cd /media/run/usb-drive/my-backup-repo && git init --bare
Bare repositories don't have a working directory. You can still git clone / git pull from them to get the contents. You can also git push to them without clobbering any "local changes" (there aren't any).

More detail here:

https://www.atlassian.com/git/tutorials/setting-up-a-reposit...

Re:Tell HN: GitHub will delete your private repo if you lose... by capableweb on Tuesday January 31, 2023 @05:27PM (#34603228)
Yeah, better in terms of saving space, but I think it confuses some people, hence I didn't use it in my above example. Previous time I recommended a co-worker to use the `push to a directory` way of copying a git repository, I made them create a bare repository, and they ended up going into the directory to verify it worked and not seeing what they expected. Cue me having to explain the difference between a normal repository and a bare one. It also confused them into thinking that a bare repository isn't just another git repository but a "special" one you can sync to, while the normal one you couldn't.

So in the end, simple is simple :) Unless you're creating remote repositories at scale, you probably won't notice a difference in storage usage.

Re:Tell HN: GitHub will delete your private repo if you lose... by josephg on Tuesday January 31, 2023 @05:39PM (#34603384)
I hear all that, but --bare is necessary in this case because git (by default) won't let you push to a non-bare filesystem branch:

    ~/temp/a:master  $ git push backup
    Enumerating objects: 3, done.
    Counting objects: 100% (3/3), done.
    Writing objects: 100% (3/3), 212 bytes | 212.00 KiB/s, done.
    Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
    remote: error: refusing to update checked out branch: refs/heads/master
    remote: error: By default, updating the current branch in a non-bare repository
    remote: is denied, because it will make the index and work tree inconsistent
    remote: with what you pushed, and will require 'git reset --hard' to match
    remote: the work tree to HEAD.
    ...
    To ../b
    ! [remote rejected] master -> master (branch is currently checked out)
    error: failed to push some refs to '../b'
Re:Tell HN: GitHub will delete your private repo if you lose... by westurner on Tuesday January 31, 2023 @06:00PM (#34603593)

  git clone --mirror
  git clone --bare
  git push --mirror
  git push --all
"Is `git push --mirror` sufficient for backing up my repository?" https://stackoverflow.com/questions/3333102/is-git-push-mirr... :

> So it's usually best to use --mirror for one time copies, and just use normal push (maybe with --all) for normal uses.

git push: https://git-scm.com/docs/git-push

git clone: https://git-scm.com/docs/git-clone

Re:Tell HN: GitHub will delete your private repo if you lose... by dabber on Tuesday January 31, 2023 @05:24PM (#34603174)
You can even take it a step further and have a push to origin update your backup as well.

https://stackoverflow.com/a/14290145

Re:Tell HN: GitHub will delete your private repo if you lose... by capableweb on Tuesday January 31, 2023 @05:35PM (#34603337)
> In recent versions of Git you can add multiple pushurls for a given remote

Woah, that's really cool, didn't know about that. This is really useful! Thanks for sharing that.

Re:Tell HN: GitHub will delete your private repo if you lose... by benatkin on Tuesday January 31, 2023 @05:04PM (#34602921)
Have you tried running gitea? It's very light on resources, has good documentation, and also defualts to a main branch. It's also very easy to control where all the data is stored, and works well w/ sqlite.
Re:Tell HN: GitHub will delete your private repo if you lose... by capableweb on Tuesday January 31, 2023 @05:18PM (#34603107)
Yes, I've tried it (and actually run a personal instance myself), but I would never try to run an application meant as an webapp when I want to copy something from one filesystem to another, when git can do it already without any external programs.

Also, the `master` is just an example, it works for `main` as well, don't worry :) The created git repository on your usb-stick works like a regular git repository, you can use whatever branch names you want.

Btw, way to focus on the absolutely least interesting part of my comment, what I chose to name the branch...

Re:Tell HN: GitHub will delete your private repo if you lose... by tryauuum on Tuesday January 31, 2023 @05:08PM (#34602972)
Is the "main" branch an advantage? I guess only if >50 percent of your repos use "main" branch
Re:Tell HN: GitHub will delete your private repo if you lose... by benatkin on Tuesday January 31, 2023 @05:16PM (#34603073)
It makes more sense. The use of the default branch varies greatly. Some use it as development and some use it as production. Main is less specific. Master, besides its negative connotation, seems to be linked with shrinkwrap software. https://en.wiktionary.org/wiki/master_copy

It's also two less characters and one less syllable.

Re:Tell HN: GitHub will delete your private repo if you lose... by Alupis on Tuesday January 31, 2023 @06:39PM (#34603999)
That is an awful lot of contortions you are doing here, to seemingly justify a word change that has had well-cemented meaning within the tech community since it's inception.

We all know why this change exists, and why some people will attempt to persuade others of it's superiority. It is, however, just silly virtue signaling, and it's exhausting to hear and read.

It would require some very irrational and underdeveloped reasoning to assert this word has anything to do with oppression in 2023. There is no negative connotation, except in those who wish to perpetuate some weird sensation of altruism... ie. no one is safer or feels better simply because you choose to call it "main" rather than "master".

Re:Tell HN: GitHub will delete your private repo if you lose... by ceejayoz on Tuesday January 31, 2023 @07:08PM (#34604285)
> It is, however, just silly virtue signaling, and it's exhausting to hear and read.

You should be aware that complaints about supposed virtue signaling are equally exhausting.

Re:Tell HN: GitHub will delete your private repo if you lose... by jrockway on Tuesday January 31, 2023 @07:11PM (#34604315)
I'm willing to go out of my way to use a different word if it makes people feel better (the root of the master -> main transition). But this is the rare case where it benefits me by having to type two less characters whenever I refer to the branch! main is truly a win/win.
Re:Tell HN: GitHub will delete your private repo if you lose... by Alupis on Tuesday January 31, 2023 @07:39PM (#34604595)
> I'm willing to go out of my way to use a different word if it makes people feel better

Which is just the thing, really. It makes no one feel better. It makes the privileged speaker feel better, with a false sense of virtue. It's a "look at how great I am" signal, nothing more.

No one is harmed or made to feel bad by using the word master. Sometimes the adults have to be present in the room, it seems.

Saving 2 characters is an equally silly excuse, but at least it has a realistic rationale. To that end, why stop at main - why not just 'm'? You can call it whatever you want in git.

Re:Tell HN: GitHub will delete your private repo if you lose... by benatkin on Tuesday January 31, 2023 @07:54PM (#34604769)
It's because main is a goldilocks word for something like a default branch name. It isn't too long and isn't too short. It also isn't shorter in terms of syllables.

Good design :)

Re:Tell HN: GitHub will delete your private repo if you lose... by sshine on Tuesday January 31, 2023 @08:40PM (#34605175)
> main is a goldilocks word

I totally agree.

> Good design

Having one default instead of two is better design.

Re:Tell HN: GitHub will delete your private repo if you lose... by sshine on Tuesday January 31, 2023 @08:37PM (#34605144)
> no one is safer or feels better

Clearly some feel better.

I personally like the name “main” better.

But it is truly a pain in the neck that different pieces of software and even different distributions of the same software now disagree about the default.

I’ve got a handful of active projects that go together that differ on master/main because they were created by different softwares.

I’d prefer “hitler” if everyone could just agree to always pick that. GitHub are the big pushers of this culture change. If they succeed, I salute them.

Re:Tell HN: GitHub will delete your private repo if you lose... by Alupis on Tuesday January 31, 2023 @08:47PM (#34605217)
There was zero disagreement about what to call the default branch in git prior to this linguistic crusade.

GitHub practically invented the exact situation you're experiencing now by changing to main for all new repos.

Git itself still defaults to master. Everything else is not the default and is the root cause for the uncertainty.

Re:Tell HN: GitHub will delete your private repo if you lose... by endgame on Tuesday January 31, 2023 @07:13PM (#34604336)
And it is _still_ causing completely avoidable pain, years after people started advocating for the change. A recent example I tripped over: https://github.com/brendanhay/amazonka/issues/815#issuecomme...
Re:Tell HN: GitHub will delete your private repo if you lose... by simcop2387 on Tuesday January 31, 2023 @05:17PM (#34603080)
The biggest reason to do this is thah it supports "mirror" repositories where it will keep your copy up to date, even using github keys to get at a private repo if you want.
Re:Tell HN: GitHub will delete your private repo if you lose... by benatkin on Tuesday January 31, 2023 @05:18PM (#34603105)
Yes, and if you stop the process and start it again, gitea doesn't complain and picks up right up where it left off. Ditto if you lose internet connectivity. It's a well-designed piece of software. I considered using it as a BaaS and am actually thinking again of using it as one.
Re:Tell HN: GitHub will delete your private repo if you lose... by neodon on Tuesday January 31, 2023 @06:29PM (#34603902)
You can change the default default branch on GitHub via <https://github.com/settings/repositories>.

I believe new GitHub accounts now have that set to main.

Re:Tell HN: GitHub will delete your private repo if you lose... by spartanatreyu on Tuesday January 31, 2023 @06:32PM (#34603936)
I did not realise you could set the remote's URL to a local filesystem path.

That opens some interesting possibilities.

Cheers

Re:Tell HN: GitHub will delete your private repo if you lose... by sangnoir on Tuesday January 31, 2023 @06:54PM (#34604158)
Gitea has a cron task that pulls-in changes on an ongoing basis.

If a snapshot suffices, a once off "git push" or "git clone" works (but that's not too far off from downloading a tar ball, is it?). If you want to have a up-to-date local copies of multiple repos, a SQLite-backed Gitea instance is the simplest solution.

An added bonus to using Gitea is flexibility in mirroring LFS objects, which can be sent to S3 or minio

Re:Tell HN: GitHub will delete your private repo if you lose... by capableweb on Tuesday January 31, 2023 @07:14PM (#34604343)
> a SQLite-backed Gitea instance is the simplest solution

Agree to disagree :)

This seems like the simplest solution:

    git remote set-url --add --push origin [email protected]:my-user/my-repo.git
    git remote set-url --add --push origin /backups/repos/my-user/my-repo.git
Now when you push to origin, it pushes to your local backup as well, everything up to date, no external sosftware at all :)

Thanks dabber for sharing this trick (https://news.ycombinator.com/item?id=34603174)

Re:Tell HN: GitHub will delete your private repo if you lose... by sangnoir on Tuesday January 31, 2023 @07:41PM (#34604614)
This does not include the cron jobs to pull in changes others make daily/weekly/every N hours. I mentioned that Gitea is superior under very specific conditions (where one wants to have latest version available locally).
Re:Tell HN: GitHub will delete your private repo if you lose... by account42 on Wednesday February 01, 2023 @10:38AM (#34611985)
The same works also over SSH - you don't need a deamon running on your server to push to it.
Re:Tell HN: GitHub will delete your private repo if you lose... by stuaxo on Tuesday January 31, 2023 @05:32PM (#34603295)
Wonder if any data hoarders have made scripts to clone every site you have started on GitHub?