python-template icon indicating copy to clipboard operation
python-template copied to clipboard

authentication confusion when doing git push in next_steps.md

Open sverhoeven opened this issue 3 years ago • 1 comments

Asked password is not your GitHub password, but must be a personal access token. This is confusing to people who have not used GitHub before.

Add https://docs.github.com/en/github-ae@latest/github/authenticating-to-github/creating-a-personal-access-token link to next_steps.md how to setup authentication.

Mentioned @bvreede during sprint demo.

sverhoeven avatar May 04 '21 08:05 sverhoeven

Hi @sverhoeven, I encounter this issue when following next_steps.md, indeed the problem was that I couldn't do git remote add origin <URL of repo> using HTTP, but by setting <URL of repo> = [email protected]:name_organization/name_repo did the trick.

luisaforozco avatar Sep 28 '22 07:09 luisaforozco

I faced the same issue. Shall I change this line

https://github.com/NLeSC/python-template/blob/3c176c5758a10f727d97bbf1435933598c5ffb65/hooks/pre_gen_project.py#L8

To

"repository": "[email protected]:" + cookiecutter.github_organization + "/" + cookiecutter.directory_name.lower().replace(" ", "-"),

And add after this

https://github.com/NLeSC/python-template/blob/3c176c5758a10f727d97bbf1435933598c5ffb65/%7B%7Bcookiecutter.directory_name%7D%7D/next_steps.md?plain=1#L5-L7

add

Note that you must setup your github authentication to do the following steps, 
see [Creating a personal access token](https://docs.github.com/en/github-ae@latest/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) 
or [Connecting to GitHub with SSH](https://docs.github.com/en/github-ae@latest/authentication/connecting-to-github-with-ssh).

apalha avatar Nov 17 '22 11:11 apalha

That would be great imho!

egpbos avatar Nov 17 '22 11:11 egpbos

@apalha That looks good!

Though if the repo address is now SSH by default, then the instructions should only be for SSH, right? So the link to the first set of instructions should be removed, or put in a different context (namely with instructions to change the address to https).

bvreede avatar Nov 17 '22 12:11 bvreede

@bvreede that is a good point.

What about this text:

Note that the next step assumes you have setup your connection to GitHub via SSH, see Connecting to GitHub with SSH.

You can also use a personal access token, see Creating a personal access token. If you choose this option below you will have to replace [email protected]: by https://github.com/.

apalha avatar Nov 17 '22 14:11 apalha

Perfect @apalha! Thanks!

bvreede avatar Nov 17 '22 14:11 bvreede

I made the changes on a new branch: 289-authentication-confusion (is this the format used?). When I try to push the branch it says I do not have permissions. I should have right?

Or should I do it with a fork?

apalha avatar Nov 18 '22 08:11 apalha

@apalha you should have permission now.

sverhoeven avatar Nov 18 '22 08:11 sverhoeven

Works now, thanks @sverhoeven ! Just made the pull request.

apalha avatar Nov 18 '22 09:11 apalha