Codeberg/Documentation
43
151
Fork
You've already forked Documentation
129

Explain HTTP push when using 2FA #87

Closed
opened 2020年09月28日 10:39:10 +02:00 by ivan-paleo · 33 comments
Contributor
Copy link

I have just activated 2FA and found that I could not push from VScode anymore. The log pointed me to the token, but it took me some time to find where to generate it (I was expecting the setting to be in "security" and not "applications").
This shoulbe documented in the help. I suggest we add that to the 2FA article.

Additionally, on Windows, this is not so easy to update the credentials. You would expect that it asks you again to enter your credentials, but it doesn't. It happened to me already so I know how to do it via the Credential Manager, but this is not straightforward. I would also add this.
I do not know about macOS/Linux.

I have just activated 2FA and found that I could not push from VScode anymore. The log pointed me to the token, but it took me some time to find where to generate it (I was expecting the setting to be in "security" and not "applications"). This shoulbe documented in the help. I suggest we add that to the 2FA article. Additionally, on Windows, this is not so easy to update the credentials. You would expect that it asks you again to enter your credentials, but it doesn't. It happened to me already so I know how to do it via the Credential Manager, but this is not straightforward. I would also add this. I do not know about macOS/Linux.
lhinderberger changed title from (削除) Add details about token when using 2FA (削除ここまで) to Explain HTTP push when using 2FA 2020年09月28日 10:52:01 +02:00
Contributor
Copy link

This problem is not present when using Git over SSH.

Please explain what token you mean?

This problem is not present when using Git over SSH. Please explain what token you mean?
Author
Contributor
Copy link

I guess it's only for HTTP.

I guess it's only for HTTP.
Contributor
Copy link

Is there a way to provide a generic explanation of this problem in Documentation? Because it would probably be an exhausting task to list how to add the token in all different GUIs, Git Clients, IDEs etc.

Is there a way to provide a generic explanation of this problem in Documentation? Because it would probably be an exhausting task to list how to add the token in all different GUIs, Git Clients, IDEs etc.
Author
Contributor
Copy link

The token is generated via Codeberg.org. On Windows, the Credential Manager manages the credentials (see the article on installing Git on Windows) so they have to be saved only once and can be used by all apps.

So for Windows at least, this can be very easy to expand the 2FA article.

Or have I misunderstood you?

The token is generated via Codeberg.org. On Windows, the Credential Manager manages the credentials (see the article on installing Git on Windows) so they have to be saved only once and can be used by all apps. So for Windows at least, this can be very easy to expand the 2FA article. Or have I misunderstood you?
Contributor
Copy link

That is good. Your reference to VS Code made it seem as if there were different ways to do this for each IDE.

That is good. Your reference to VS Code made it seem as if there were different ways to do this for each IDE.
Contributor
Copy link

@ivan-paleo Would you like to extend the article? :)

@ivan-paleo Would you like to extend the article? :)
Author
Contributor
Copy link

@ivan-paleo Would you like to extend the article? :)

Yes, I will try to do it this week, but I'm not sure I'll have enough time.

> @ivan-paleo Would you like to extend the article? :) Yes, I will try to do it this week, but I'm not sure I'll have enough time.
Author
Contributor
Copy link

Before I start working on it, I have a somewhat important question:

I have forked the Documentation repo some time ago. Since then, quite a few things happened on the main repo.
So should I somehow update my outdated fork from the main repo before continuing working on it?

That sounds like a good idea to me, but I have no idea on how to do that. Alternatively, I could re-fork, but I'm not sure how it is to work with 2 forks of the same repo.

EDIT: something to add to the contributor FAQ #92 maybe?

Before I start working on it, I have a somewhat important question: I have forked the Documentation repo some time ago. Since then, quite a few things happened on the main repo. So should I somehow update my outdated fork from the main repo before continuing working on it? That sounds like a good idea to me, but I have no idea on how to do that. Alternatively, I could re-fork, but I'm not sure how it is to work with 2 forks of the same repo. EDIT: something to add to the contributor FAQ #92 maybe?
Owner
Copy link
see https://docs.codeberg.org/collaborating/pull-requests-and-git-flow/
Author
Contributor
Copy link

see https://docs.codeberg.org/collaborating/pull-requests-and-git-flow/

Is there also a way to do it through the Codeberg web interface and/or on VSCode/VSCodium?

> see https://docs.codeberg.org/collaborating/pull-requests-and-git-flow/ Is there also a way to do it through the Codeberg web interface and/or on VSCode/VSCodium?
Contributor
Copy link

So should I somehow update my outdated fork from the main repo before continuing working on it?

Yes, that's a good idea. If you have already started working, you want to rebase it as described in @hw's link. If you haven't it's easier to pull the newest upstream changes into your local master branch and to then create a new branch from that.

EDIT: something to add to the contributor FAQ #92 maybe?

I'd like to keep that focused on Documentation-specific topics, not so much on general Git usage. That's what the "Working with Git repositories" section is for.

> So should I somehow update my outdated fork from the main repo before continuing working on it? Yes, that's a good idea. If you have already started working, you want to rebase it as described in @hw's link. If you haven't it's easier to pull the newest upstream changes into your local master branch and to then create a new branch from that. > EDIT: something to add to the contributor FAQ #92 maybe? I'd like to keep that focused on Documentation-specific topics, not so much on general Git usage. That's what the "Working with Git repositories" section is for.
Author
Contributor
Copy link

If you haven't it's easier to pull the newest upstream changes into your local master branch and to then create a new branch from that.

That's exactly what I would like to do, but how do I pull from the upstream (original) master into my master branch?

Is it just the same procedure without rebase (git pull --rebase upstream master)?

> If you haven't it's easier to pull the newest upstream changes into your local master branch and to then create a new branch from that. That's exactly what I would like to do, but how do I pull from the upstream (original) master into my master branch? Is it just the same procedure without rebase (`git pull --rebase upstream master`)?
Contributor
Copy link

Yes, you pull from upstream by executing git pull upstream master. In VSCode / Codium you can pull from the Git tab by clicking on the "..." Button -> "Pull, Push" -> "Pullen von..." (I assume "Pull from..." in English 😉).

Make sure you're on your master branch though before doing this.

Yes, you pull from upstream by executing `git pull upstream master`. In VSCode / Codium you can pull from the Git tab by clicking on the "..." Button -> "Pull, Push" -> "Pullen von..." (I assume "Pull from..." in English :wink:). Make sure you're on your master branch though before doing this.
Author
Contributor
Copy link

Yes, you pull from upstream by executing git pull upstream master. In VSCode / Codium you can pull from the Git tab by clicking on the "..." Button -> "Pull, Push" -> "Pullen von..." (I assume "Pull from..." in English 😉).

That sounds exactly what I was looking for.
Just one more detail: I should then "pick a remote to pull from". I guess I should specify the master branch of the repo, but in which format?

Sorry for these basic questions...!

> Yes, you pull from upstream by executing `git pull upstream master`. In VSCode / Codium you can pull from the Git tab by clicking on the "..." Button -> "Pull, Push" -> "Pullen von..." (I assume "Pull from..." in English :wink:). That sounds exactly what I was looking for. Just one more detail: I should then "pick a remote to pull from". I guess I should specify the master branch of the repo, but in which format? Sorry for these basic questions...!
Contributor
Copy link

That format should be the same as the URL you use when cloning a repository.

That format should be the same as the URL you use when cloning a repository.
Author
Contributor
Copy link

That format should be the same as the URL you use when cloning a repository.

That was the obvious one that I tried (sorry for not mentioning, Friday was busy), and it doesn't work: VSCodium doesn't let me validate it and does nothing.
Maybe I should specify the branch somehow?

> That format should be the same as the URL you use when cloning a repository. That was the obvious one that I tried (sorry for not mentioning, Friday was busy), and it doesn't work: VSCodium doesn't let me validate it and does nothing. Maybe I should specify the branch somehow?
Contributor
Copy link

It could be that you first need to add this repository as your upstream repo using "..." -> "Remotes" -> "Remoterepository hinzufügen..." (something like Add Remote Repository).

It could be that you first need to add this repository as your upstream repo using "..." -> "Remotes" -> "Remoterepository hinzufügen..." (something like Add Remote Repository).
Author
Contributor
Copy link

It could be that you first need to add this repository as your upstream repo using "..." -> "Remotes" -> "Remoterepository hinzufügen..." (something like Add Remote Repository).

I feel really stupid now, but I've added the remote, and I can now select it in "pull from", but then it asks for the branch. "master" does not lead me further...

> It could be that you first need to add this repository as your upstream repo using "..." -> "Remotes" -> "Remoterepository hinzufügen..." (something like Add Remote Repository). I feel really stupid now, but I've added the remote, and I can now select it in "pull from", but then it asks for the branch. "master" does not lead me further...
Contributor
Copy link

"master" does not lead me further...

Why not - is there an error message?

> "master" does not lead me further... Why not - is there an error message?
Author
Contributor
Copy link

"master" does not lead me further...

Why not - is there an error message?

That would be nice, but no: I just cannot validate (pressing ENTER does not do anything)

> > "master" does not lead me further... > > Why not - is there an error message? That would be nice, but no: I just cannot validate (pressing ENTER does not do anything)
Contributor
Copy link

Can you bring up a terminal in VSCodium and have a look at the output of git status and git remote -v? Maybe that brings up more clues on what went wrong.

And if you're already in the terminal, you might as well pull from there too. The command is git pull upstream master, assuming your upstream remote is called upstream.

That's the thing with GUIs: They seem easy, but looking closer they're suprisingly complex. In addition, there's no short, concise and easy way to put GUI workflows in writing whereas for terminal apps it's often just a one-liner. That must be why many developers prefer to do things on the terminal.

Can you bring up a terminal in VSCodium and have a look at the output of `git status` and `git remote -v`? Maybe that brings up more clues on what went wrong. And if you're already in the terminal, you might as well pull from there too. The command is `git pull upstream master`, assuming your upstream remote is called `upstream`. <sub>That's the thing with GUIs: They seem easy, but looking closer they're suprisingly complex. In addition, there's no short, concise and easy way to put GUI workflows in writing whereas for terminal apps it's often just a one-liner. That must be why many developers prefer to do things on the terminal.</sub>
Author
Contributor
Copy link

@lhinderberger are you trying to bring me to the dark side?! ;)

@lhinderberger are you trying to bring me to the dark side?! ;)
Author
Contributor
Copy link

Here the output:

PS ...\Documentation> git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
PS ...\Documentation> git remote -v
origin https://codeberg.org/ivan-paleo/Documentation.git (fetch)
origin https://codeberg.org/ivan-paleo/Documentation.git (push)
upstream https://codeberg.org/Codeberg/Documentation.git (fetch)
upstream https://codeberg.org/Codeberg/Documentation.git (push)
Here the output: ``` PS ...\Documentation> git status On branch master Your branch is up to date with 'origin/master'. nothing to commit, working tree clean PS ...\Documentation> git remote -v origin https://codeberg.org/ivan-paleo/Documentation.git (fetch) origin https://codeberg.org/ivan-paleo/Documentation.git (push) upstream https://codeberg.org/Codeberg/Documentation.git (fetch) upstream https://codeberg.org/Codeberg/Documentation.git (push) ```
Author
Contributor
Copy link

git pull upstream master indeed works very easily and smoothly...!

`git pull upstream master` indeed works very easily and smoothly...!
Contributor
Copy link

Here the output: [...]

Looks perfectly fine to me. 👍

git pull upstream master indeed works very easily and smoothly...!

That's very good to hear :)

@lhinderberger are you trying to bring me to the dark side?! ;)

Hehe, yes 😄 Using git from the command line will have a bit of a learning curve, but I think it'll make your life easier in the long run. Especially when running into more advanced problems, instructions tend to be focused on the command line.

> Here the output: [...] Looks perfectly fine to me. :thumbsup: > `git pull upstream master` indeed works very easily and smoothly...! That's very good to hear :) > @lhinderberger are you trying to bring me to the dark side?! ;) Hehe, yes :smile: Using git from the command line will have a bit of a learning curve, but I think it'll make your life easier in the long run. Especially when running into more advanced problems, instructions tend to be focused on the command line.
Author
Contributor
Copy link

Hehe, yes 😄 Using git from the command line will have a bit of a learning curve, but I think it'll make your life easier in the long run. Especially when running into more advanced problems, instructions tend to be focused on the command line.

I've already noticed that ;)

By the way, I don't quite understand this syntax from the documentation:
git remote add upstream git@codeberg.org:Codeberg/build-deploy-gitea.git
What is the git@codeberg.org: for?
Why not the whole repo URL, like https://codeberg.org/Codeberg/build-deploy-gitea.git?

> Hehe, yes :smile: Using git from the command line will have a bit of a learning curve, but I think it'll make your life easier in the long run. Especially when running into more advanced problems, instructions tend to be focused on the command line. I've already noticed that ;) By the way, I don't quite understand this syntax from the documentation: `git remote add upstream git@codeberg.org:Codeberg/build-deploy-gitea.git` What is the `git@codeberg.org:` for? Why not the whole repo URL, like `https://codeberg.org/Codeberg/build-deploy-gitea.git`?
Contributor
Copy link

That's because it's an SSH path, not an HTTPS URL. The article assumes you're connecting over SSH.

That's because it's an SSH path, not an HTTPS URL. The article assumes you're connecting over SSH.
Contributor
Copy link

What is the git@codeberg.org: for?

It signifies that the connection via SSH should be done to host codeberg.org using system username git for connection, with your SSH key identifying you as the actual codeberg user. The SSH protocol is implied (I would like it to be explicit too, but I can't get it to work by prepending ssh://).

> What is the `git@codeberg.org:` for? It signifies that the connection via SSH should be done to host codeberg.org using system username `git` for connection, with your SSH key identifying you as the actual codeberg user. The SSH protocol is implied (I would like it to be explicit too, but I can't get it to work by prepending `ssh://`).
Author
Contributor
Copy link

What is the git@codeberg.org: for?

It signifies that the connection via SSH should be done to host codeberg.org using system username git for connection, with your SSH key identifying you as the actual codeberg user. The SSH protocol is implied (I would like it to be explicit too, but I can't get it to work by prepending ssh://).

Thanks for the explanations! SSH is the next thing I have to look into...!

> > What is the `git@codeberg.org:` for? > > It signifies that the connection via SSH should be done to host codeberg.org using system username `git` for connection, with your SSH key identifying you as the actual codeberg user. The SSH protocol is implied (I would like it to be explicit too, but I can't get it to work by prepending `ssh://`). Thanks for the explanations! SSH is the next thing I have to look into...!
Contributor
Copy link

You're welcome! :)

You're welcome! :)
Author
Contributor
Copy link

I'm having troubles with this article. Not with the creation of tokens (that's very easy), but with the management of credentials.
I still haven't quite understood how it works on Windows (the "new" Git Credential Manager Core does not save the credentials on my machine - I've opened issue #188) and I don't know how to configure it: how to save more than 1 token per machine? how to save the token only for say 15 min? how to make sure the token is never saved (e.g. if you use a password manager)? And of course, I have no idea about macOS or Linux.

I think this is an important topic too, but it probably deserves its own article, right? If that's indeed the case, I will just stop at the creation of the token and saying "save it in a safe place" or something. Later we can add a link to the new article.

What do you guys think?

EDIT: of course, all that relates to HTTP only. I know that most of you use SSH.

I'm having troubles with this article. Not with the creation of tokens (that's very easy), but with the management of credentials. I still haven't quite understood how it works on Windows (the "new" [Git Credential Manager Core](https://github.com/microsoft/Git-Credential-Manager-Core) does not save the credentials on my machine - I've opened [issue #188](https://github.com/microsoft/Git-Credential-Manager-Core/issues/188)) and I don't know how to configure it: how to save more than 1 token per machine? how to save the token only for say 15 min? how to make sure the token is never saved (e.g. if you use a password manager)? And of course, I have no idea about macOS or Linux. I think this is an important topic too, but it probably deserves its own article, right? If that's indeed the case, I will just stop at the creation of the token and saying "save it in a safe place" or something. Later we can add a link to the new article. What do you guys think? EDIT: of course, all that relates to HTTP only. I know that most of you use SSH.
Author
Contributor
Copy link

I have added some details in PR #97

I have added some details in PR #97
Author
Contributor
Copy link

I guess this issue can be closed now, right?

I guess this issue can be closed now, right?
Sign in to join this conversation.
No Branch/Tag specified
main
renovate/cspell-monorepo
renovate/docker.io-woodpeckerci-plugin-surge-preview-1.x
renovate/docker.io-woodpeckerci-plugin-prettier-1.x
renovate/codeberg.org-woodpecker-plugins-node-pm-1.x
renovate/node-lts-slim
git-pages
pr-554
pr/554
gitea-icons-shortcode
No results found.
Labels
Clear labels
Codeberg Pages

Issues affecting Codeberg Pages
Documentation Usability

Issues related to using and reading docs.codeberg.org
Forgejo
Good First Issue! 👋
Kind: Bug
Kind: Documentation
Kind: Enhancement
Kind: Feature
Kind: Question
Kind: Security
Licensing
Part: Generator

This is related to the generation of the documentation, not to the content itself
Priority: High

The priority is high
Priority: Low

The priority is low
Priority: Medium

The priority is medium
Reviewed: Confirmed

Something has been confirmed
Reviewed: Duplicate

Something exists already
Reviewed: Invalid

Something was marked as invalid
Reviewed: Wontfix

Something won't be fixed
Status: Blocked
Status: Help wanted

Contributions are welcome!
Status: In progress

Work is in progress
Status: Needs feedback

Feedback is needed
Status: Ready for Review

Work is completed
Status: Review

Review is in progress / Reviewers wanted
Status: Stale
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Codeberg/Documentation#87
Reference in a new issue
Codeberg/Documentation
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?