Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

impossible de commit and push #1102

Open
JustVinz29 opened this issue Apr 12, 2023 · 2 comments
Open

impossible de commit and push #1102

JustVinz29 opened this issue Apr 12, 2023 · 2 comments

Comments

@JustVinz29
Copy link

Bonjour. dans Eclipse j'ai un message d'erreur quand j'essai de commit and push qui indique ceci :
Can't connect to any repository: https://github.com/JustVinz29/oc-install-ide-cours.git (https://github.com/JustVinz29/oc-install-ide-cours.git: not authorized)

@Namoib
Copy link

Namoib commented Apr 21, 2023

@CapitainFlam
Copy link
Contributor

CapitainFlam commented Feb 13, 2024

🇫🇷 French here, 🇬🇧 ENGLISH translation BELOW.

La réponse StackOverflow est très complète... Même si elle est parfois un peu sibylline.
Évidement, vous devez déjà avoir un compte GitHub, et être connecté pour faire cette manip.

Voici ma version traduite et amendée. ...Si ça ne marche pas, au moins, on aura essayé, c'est sans doute que quelque chose a encore changé, donc celui ou celle qui trouve la solution commentera ci-dessous.

Traduction ci-dessous de : https://stackoverflow.com/questions/68790276/pushing-from-eclipse-to-my-github-repository-via-https-stopped-working-git-rec , n'hésitez pas à aller voir cette réponse pour les autres possibilités (SSH...) et/ou si cela ne fonctionne pas, sans doute que la réponse / modification aura été postée là-bas.

EDIT : en plus, les méthodes officielles proposées par GitHub sont décrites ici.

1. Dans GitHub : générer le token (jeton) d'accès aux API

  • Sur votre compte GitHub, allez dans Settings > Developer settings > Personal access tokens ( lien : https://github.com/settings/tokens ) :

  • Cliquez sur le bouton Generate new token, en haut à droite, puis choisissez CLASSIC.
    token creation 1

  • Saisissez une note, par exemple 'GitHub repo token' (jeton de repo GitHub).
    token creation 2

  • Choisissez une durée avant Expiration, par exemple Pas d'expiration, n'importe quelle date

  • Cochez la case repo

  • Cliquez sur le bouton Generate token en bas de page

  • Copiez le jeton généré dans le presse-papiers
    token successful

  • Attention à copier le token avant de refermer cette fenêtre ! Vous ne pourrez plus récupérer cette valeur ensuite, car c'est considéré comme un mot de passe. Voir ci-dessous si vous n'avez pas copié ou perdu le token.

2. Dans Eclipse, utiliser ce token

  • Dans la perspective Git Repositories

  • Dépliez le noeud Remotes de votre projet forké
    remotes - origin - configure push

  • Cliquez avec le bouton droit de la souris sur le sous-nœud (origin, ou le nom que vous avez choisi lorsque vous avez cloné le dépôt) et choisissez Configure Push (Configurer la poussée)...
    remotes - origin - configure push 2

  • Cliquez sur le bouton Change... en haut à droite pour modifier l'URI.

  • Dans User, remettez votre Username de connexion.

  • Dans Password, copiez collez le jeton GitHub. Il remplace votre mot de passe.
    remotes - origin - configure push 3

  • Cochez la case Store in Secure Store, pour que cela soit enregistré et conservé (si vous ne cochez pas cette case, donc que vous ne voulez pas stocker sur le PC votre token, vous pouvez aussi utiliser votre token à la place de votre mot de passe à chaque Push que vous effectuez, dans la fenêtre de connexion)
    push fini 1

  • Cliquez sur Terminer et Enregistrer pour appliquer les changements

...Et voilà 👍 . Vous pouvez maintenant Commit et Push en toute quiétude avec un jeton (token) d'accès aux API de GitHub ! 🎉

Oups ! J'ai pas copié mon token / j'ai perdu mon token

C'est moche ! 😅

Vous pouvez le voir, toujours dans Settings > Developer settings > Personal access tokens ( lien : https://github.com/settings/tokens ), mais vous ne pourrez plus accéder à sa valeur.
available token

Vous pouvez le modifier, ou le détruire pour le re-créer, mais dans les deux cas, il faudra ré-enregistrer ce nouveau token dans Eclipse, et éventuellement l'enregistrer (à nouveau) dans le Secure Store.
lost token

🇬🇧 ENGLISH translation :

The StackOverflow response is very comprehensive... Even if it is sometimes a little cryptic.
Of course, you must already have a GitHub account, and be logged in to do this.

Here's my translated and amended version (and translated back to english). ...If it doesn't work, at least we've tried, it's probably because something has still changed, so whoever finds the solution will comment below.

Translation below from: https://stackoverflow.com/questions/68790276/pushing-from-eclipse-to-my-github-repository-via-https-stopped-working-git-rec , feel free to check this answer for other possibilities (SSH...) and/or if it doesn't work, the answer/amendment will probably have been posted there.

EDIT : in addition, the official methods proposed by GitHub are described here.

1. In GitHub: generate the API access token

  • On your GitHub account, go to Settings > Developer settings > Personal access tokens ( link: https://github.com/settings/tokens ) :

  • Click on the Generate new token button at the top right, then choose CLASSIC.
    token creation 1

  • Enter a note, for example 'GitHub repo token'.
    token creation 2

  • Choose a duration before Expiration, e.g. No expiry, any date

  • Tick the repo box

  • Click on the Generate token button at the bottom of the page

  • Copy the generated token to the clipboard
    token successful

  • Make sure you copy the token before closing this window! You will not be able to retrieve this value afterwards, as it is considered to be a password. See below if you have not copied or lost the token.

2. In Eclipse, use this token

  • In the Git Repositories perspective

  • Expand the Remotes node of your forked project
    remotes - origin - configure push

  • Right-click on the sub-node (origin, or the name you chose when you cloned the repository) and choose Configure Push...
    remotes - origin - configure push 2

  • Click on the Change... button at the top right to change the URI.

  • In User, enter your login username.

  • In Password, copy and paste the GitHub token. It will replace your password.
    remotes - origin - configure push 3

  • Check the Store in Secure Store box, so that this is recorded and saved (if you don't check this box, so you don't want to store your token on the PC, you can also use your token instead of your password for each push you make, in the connection window).
    push fini 1

  • Click Finish and Save to apply the changes

...And that's it 👍 . You can now Commit and Push in peace with a token for access to the GitHub APIs! 🎉

Oops! I didn't copy my token / I lost my token

This is bad! 😅

You can still see it in Settings > Developer settings > Personal access tokens ( link: https://github.com/settings/tokens ), but you won't be able to access its value.
available token

You can modify it, or destroy it to re-create it, but in both cases, you'll have to re-register this new token in Eclipse, and possibly save it (again!) in the Secure Store.
lost token

Translated with www.DeepL.com/Translator (free version) ...and a few correction from me afterward.

CapitainFlam added a commit to CapitainFlam/oc-install-ide-cours that referenced this issue Feb 13, 2024
NOTE pour le commit/push sur GitHub (ajoutée en février 2024) :

Depuis le 13 août 2021, GitHub n'autorise plus l'accès par authentification simple à ses API (c'est quoi une API?), comme expliqué ici par GitHub. (...Eclipse utilise les API pour mettre à jour GithHub ! Oups.)

🎉 La solution pour contourner le problème est décrite dans l'issue geoffreyarthaud#1102 (geoffreyarthaud#1102)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants