Live data from Hacker News

Git password authentication is shutting down

github.blog

151–160 of 353 posts

Re: Git password authentication is shutting down

#151

Earlier quoted context omitted.

Do you want to be the one to explain PGP and revcerts to somebody who has used the same password for everything their whole life?

That's why I said 'something like'. An extension of the idea adapted for wider use. I'm certain such a person uses TCP/IP every day and doesn't need it explained. Yet twenty years ago, some knowledge of IP addresses and subnet masks etc was necessary to get connected.

Yeah, I think WebAuthn is fairly seamless. Ordinary users do not have to worry about certificates or anything. They just log in with their face, fingerprint, or a computer-local PIN.

I think what prevents wider adoption of WebAuthn is the fear that users are going to lose their phone and not have a backup authenticator. But, people probably lose their phone less often than they forget passwords, so I doubt it changes the support burden much.

Re: Git password authentication is shutting down

#152
post #44

Earlier quoted context omitted.

In this case it is a younger college student who's interested in web development but hasn't done any CS learning and isn't generally familiar with tech.

Does someone who just wants to experiment with a little bit of web-dev really need to have version control right away? Seems a bit out of scope. That seems like a concept that can wait a few months while they actually just explore writing some code first.

If the person learning just wants to write some HTML in a file and put that on a server somewhere as the index.html file then maybe version control is overkill.

But, if this person's goal is about creating a web application then version control is a good skill to have. I remember the days when source code for a web application was something we could zip up and hand to a client. But, these days, more than likely you have a remote server somewhere and you need to SSH into it and from there you could SFTP the files but at that point why not just use git and it's branch management. Obviously, there are more arguments that can be made for learning git.

Re: Git password authentication is shutting down

#153

Earlier quoted context omitted.

> How can we offer a more gentle learning curve for budding developers while still requiring "real" projects to use best practices for security and development Difficult question. In the past, the solution was just not to use any of that. A bunch of files inside a random folder in your computer that were not version controlled in any way. That worked, but that's also the reason I lost most of the source code that I'v…

> In the past, the solution was just not to use any of that. A bunch of files inside a random folder in your computer This is what my company does. Except we use git. Everyone just keeps their repo on their drive and there's no central "canonical" repository. Everyone has a personal folder in the main fileserver and they push frequently to their personal remote repo. Any time they send emails saying they've made a no…

What do you release from - just whatever personal repo has all the features you need? This is interesting because you're kinda using git as the fully distributed system that it's design allows for, which isn't that common.

Re: Git password authentication is shutting down

#154

Earlier quoted context omitted.

I've used GitExtensions from the start of my Git usage. I've never had to blow any of my repos away at any point. I also use things like Rebase without thinking about it, something which from what I've read on here is considered a slightly unusual/difficult task. Using GitExtensions means I can use Git as easily as any other tool, I never give it a second thought. I see the command line commands being executed, but n…

I used GitExtension for years, but then I switched to Linux some years ago, so I had to find an alternative. I used SourceTree for a while, but I hated the UX. I tried GitKraken when it first came out, but it had a lot of issues that didn't make it appropriate for my workflow. After a couple more years, GitKraken had improved enough that I was able to switch to it. I've been using it for maybe 4 or 5 years now.

GitKraken is amazing, I'm a happy customer through work. makes me happy when electron apps aren't crap.

Re: Git password authentication is shutting down

#155

I'm fine with this change for my usage, I don't think I've used password auth for myself or any automated service I've setup for years now. However, this will introduce more confusion for newcomers who already have to figure out what Git, GitHub, etc are. I just spent some time last weeekend teaching someone the basics of how to create a new project. Such a simple idea required introducing the terminal, basic termina…

Teaching git & Github to someone that doesn't know how to use a terminal is like teaching calculus to someone that doesn't know how to add. Of course you won't be able to do it in a couple of hours. Most people spend years learning the things that are required to understand how git works, or at least many months if you want to learn in a fast, intensive manner.

> Most people spend years learning the things that are required to understand how git works

They don't need to know how git works, they need to know how to use it.

Just like I don't need to know the details of an internal combustion engine to drive a car, someone who only does CSS work doesn't need to know how git works to push commits. A simple GUI interface suffices there.

The problem is that the official Git GUI interface is unbelievably bad and happily lets you put yourself into situations that the GUI is completely incapable of getting out of. A default GUI that can't essentially softlock itself would be fine for most casual users.

Re: Git password authentication is shutting down

#156

Earlier quoted context omitted.

The command you want is "git pull --rebase". There are configuration settings to make "git pull" rebase by default, and I'd recommend always turning that on that default (which may be by why the person above omitted it from his pull command). I actually thought "git pull" did "git pull --rebase" by default (this may be what you get from running `git --configure` without modifications?), but maybe I've just been confi…

I actually don't want to rebase. Rebase can rewrite your local history and make it impossible for you to push without doing a force push (or some other more complicated manuevering). The only time pull with rebase is okay (on a shared branch such as master) is when you know that your local branch is strictly behind remote. That's exactly what --ff-only does. It rebases only if you are behind remote, and declines to d…

If "git pull --rebase" succeeds without reporting a merge conflict, then it's tantamount to having executed the command with "--ff-only".

I believe you are incorrect however. "git pulll --rebase" will not ever rewrite history from the origin repository. It will only ever modify your local unpublished commits to account for new commits from the origin branch. If your change and the new commits from origin aren't touching the same lines or files, then the update is seamless [1].

If there is a conflict because your change and a new commit from origin both changed the same line in the same file, this can result in a merge commit that you need to resolve. But you resolve this locally, by updating your (unpushed, local) commit(s) to account for the new history. When you complete the merge, it will not show up as a merge commit in the repository -- you will simply have simply amended your local unpublished commit(s) only to account for the changes in upstream, and you will have seen every conflict and resolved each one yourself. When the process is complete, and you've resolved the merge, you'll have a nice linear branch where your commit(s) are on the tip of the origin branch.

The flag "--ff-only" basically just means "refuse to start a local merge while performing this operation, and instead fail".

Because of the potential for these merge conflicts, it's a best practice to "git pull" frequently, so that if there are conflicts you can deal with them incrementally (and possibly discuss the software design with coworkers/project partners if the design is beginning to diverge -- and so people can coordinate what they're working on and try to stay out of each other's way), instead of working through a massive pile of conflicts at the end of your "local 'branch'" (i.e. the code in your personal Git repo that constitutes unpushed commits to the upstream branch).

Additionally, all of the central Git repositories I've worked in in a professional context were also configured to disallow "git push --force" (a command that can rewrite history), for all "real" branches. These systems gave users their own private Git repo sandbox (just like you can fork a repo on GitHub) where they can force push if they want to (but is backed up centrally like GitHub to avoid the loss of work). This personal repo was very useful for saving my work. I was in the habit of committing and pushing to the private repo about once every 30m-1h (to eliminate the chance of major work loss due to hardware failure). Almost always I'd squash all of these commits into one before rebasing onto master, so that the change comes in as a single commit, unless it would be too large to review.

In the occasional circumstances where I've legitimately needed to rewrite history for some reason -- say credentials got into the repository, or someone generated one of these "merge master into master" commits -- then I would change HEAD from master to another branch, delete master, and then recreate it with the desired state. (And even that operation would show up in the system's logs, so in the case of something like credentials you'd additionally contact the security or source control team to make sure the commit objects containing the credentials were actually deleted out of the repo history completely, including stuff you can find only via the reflog.) Then contact the team working on the repo to let them know that you had to rewrite history to correct a problem.

I would recommend disabling "git push --force" for all collaborative projects. If you're operating the repository, you can do this by invoking "git config --system receive" and setting "denyNonFastForwards true". In GitHub there's probably a repository setting switch somewhere.

Once professional software engineers start working with Git all day long, they quickly get past the beginner stage and the need to do this kind of stuff is very rare.

[1] It doesn't mean the software will work though, even if both changes would have worked in isolation. You still need to inspect and test the results of "git pull (--ff-only)", since even if there are no conflicts like commits that modify the same lines as yours, or there are conflicts that Git can resolve automatically, it's possible for the resultant software logic to be defective, since Git has no semantic understanding of the code.

Re: Git password authentication is shutting down

#157

I use TortoiseGit under Windows. It took me 3 days (on and off) to figure out how to push code to my repositories again. The amount of misleadng and confusing information on the internet is extraordinary. Signed: a developer with well over a decade of experience in version control, *nix, Windows, crypto, etc.

I'd be really interested in hearing about your struggles - this tells me there's something really wrong with the tutorials you were reading (through no fault of your own).

It was a month ago and I didn't note down all my attempts. It went something like:

Pushes were not working. I re-entered my password a few times, checked other config settings a few times before Googling the Git error message, which led me to find that GitHub's security policy was changing.

I tried an SSH login (fail), switched to trying locally generated SSH keys.

Used PuTTY's "puttygen.exe" to make an SSH key. Did that, then found it was a newer format that Tortoise could not handle. Used TortoiseGit's copy of "puttygen.exe". Did this a few times as GitHub wouldn't accept the format that my key was in.

Gave up on GUI key generation, tried command-line and failed a few more times.

I think I looked at personal access tokens at some point.

Went back to GUI SSH file creation, and managed to upload my puttygen SSH key by copy/pasting from part of the dialog box that I hadn't tried before.

Used GitHub's "git@github.com:/repo" syntax to get a fresh clone of my repo. Finally I realised that I needed to use the github URL syntax combined with "Load Putty Key" ticked and pointing to my private key

I'm still not sure if it's the right way or the best way, but it worked, so I stopped looking.

Re: Git password authentication is shutting down

#158
post #51

Ok I'll admit it. I'm the dingus who is still using https and login/password. It's how I learned to use it years ago and since I only ever access GitHub via cli it's all I've ever learned. I don't program anything complex and I've never put anything secure up on GitHub (it's public, after all, so i had the expectation that all info on there is insecure). I don't understand why this is being deprecated when it's the d…

You forgot about the part where you run `git push` later and realize it didn't save your passkey, so you have to make another one. This time you Google how to save it and copy the top answer on StackOverflow, which uses the git credentials store to save it in plain text in your ~/.gitconfig file. Now is the passkey more secure?

That seems more like a problem with StackOverflow than anything else.

Re: Git password authentication is shutting down

#159
post #41

When will we get repo-specific tokens? That's what I really want. As-is, I've just created extra special purpose github accounts, but that's a bad solution IMO.

I'm guessing that if that's gonna happen (cmon, it's gotta) they view this migration as a pre-requisite

> they view this migration as a pre-requisite

It's hard to picture how it could be.

Re: Git password authentication is shutting down

#160

Earlier quoted context omitted.

I'd be really interested in hearing about your struggles - this tells me there's something really wrong with the tutorials you were reading (through no fault of your own).

It was a month ago and I didn't note down all my attempts. It went something like: Pushes were not working. I re-entered my password a few times, checked other config settings a few times before Googling the Git error message, which led me to find that GitHub's security policy was changing. I tried an SSH login (fail), switched to trying locally generated SSH keys. Used PuTTY's "puttygen.exe" to make an SSH key. Did…

I don't think I can recommend anyone use PuTTY on Windows anymore, partly because of issues like this. It might be that TortoiseGit is old, but ssh.exe should be available on Windows 10 now.
Post reply on HN