Can’t finish github sharing process [duplicate]
I’m trying to share one of my IntelliJ projects on GitHub, but whenever I try to do that, I get an error that says it successfully created the project but initial commit failed. It gives me instructions on how to fix this, but I have no idea what the instructions mean. Can anyone decipher the error and tell me what to do?
Here is the error:
1 Answers
Basically, before you can create a commit, git needs to know who you are and how to refer to you. To tell git who you are, run the following commands.
Set the user name:
After that you will be able to create commits. Probably you can just rerun whatever you did that lead to this error.
Cant finish github sharing process что делать
I’m trying to share one of my IntelliJ projects on GitHub, but whenever I try to do that, I get an error that says it successfully created the project but initial commit failed. It gives me instructions on how to fix this, but I have no idea what the instructions mean. Can anyone decipher the error and tell me what to do?
Here is the error:
1 Answer 1
Basically, before you can create a commit, git needs to know who you are and how to refer to you. To tell git who you are, run the following commands.
Set the user name:
After that you will be able to create commits. Probably you can just rerun whatever you did that lead to this error.
Вопрос №50804 от пользователя Кирилл в уроке «Рабочий процесс», курс «Введение в Git»
make: Entering directory ‘/usr/src/app’
FAIL tests/index.test.js
✓ test-teacher-git (18 ms)
✓ test-user-git-start (4 ms)
✕ test-user-git-finish (6 ms)
Test Suites: 1 failed, 1 total Tests: 1 failed, 2 passed, 3 total Snapshots: 0 total Time: 0.676 s, estimated 1 s Ran all test suites.
How to fix — git@github.com permission denied (publickey). fatal could not read from remote repository and Support for password authentication was removed. Please use a personal access token instead
One of the easiest ways for you to generate a key pair is by running ssh-keygen utility.
Open the command prompt and type in the following
(Note — If you do not have ssh-keygen installed on the window then Click here.)
To keep the ssh-keygen simple, do not enter any key name or passphrase.
Where to find the key pair
The file will be generated at — /Users/rahulwagh/.ssh/
Name of the file — id_rsa.pub
(To generate SSH keys on Windows machine click here)
Step 2 — Adding SSH key to your GitHub account
- Goto your GitHub Account -> Settings
Git hub account settings
- Then look for SSH and GPG keys under **Account Settings -> SSH and GPG keys **
github ssh and gpg keys
- After that click on New SSH Key. Assign some meaningful name to your key
GitHub new ssh keys
- To get the key goto to your command prompt and switch directory path
Windows — C:\Users\rahulwagh.ssh\id_rsa.pub
Linux — /Users/rahulwagh/.ssh/id_rsa.pub
Run the following command
Copy the content of the key
Paste the key inside your GitHub account
Git hub account settings
Now you can clone your GitHub repo and it will not complain about git@github.com permission denied (publickey). fatal could not read from remote repository
Benefits of this approach
- You do not need to supply you GitHub Username and password
- More secured
Drawback
- The process of generating SSH keys is little troublesome.
- If you switch your laptop/desktop then you need re-generate the SSH keys again and perform the same steps onto your new laptop/desktop.
Approach 2 : Using GitHub HTTPS urls
This is one more approach in which you do not need to worry about SSH key generation.
You need following —
- GitHub repo URL with HTTPS (Ex — https://github.com/rahulwagh/example.git)
- Your GitHub Username
- Your GitHub Password
Run the following command to set git remote
After that it will ask for your username and password , supply your username and password.
Once you are authenticated then you can perform your Git operations.
Benefits of this approach
- You do not need to generate SSH keys
- You do not need to copy your SSH keys to GitHub accounts
- This approach can be used from any Laptop, Desktop. You only need to provide your GitHub credentials with this approach.
Drawback
- The only drawback which I can see is you need to input your GitHub credentials everytime.
2. GitLab: How to fix gitlab.com: permission denied (publickey) fatal: Could not read from remote repository
2.1 Multiple public keys inside
When you are working with multiple github repositories then there is high probability that you might have incorrect public key mentioned inside your
For example I have generated the public key for my GitLab project by the name
But when I checked my
/.ssh/config file I noticed the incorrect name of public key for the gitlab.com
Here is the content of my
/.ssh/config file where the public key name is
/.ssh/id_rsa instead of
How to fix?
To fix this issue you should correct the public key name —
3. Bitbucket — Permission denied (public key), can’t clone/clone to bitbucket
There could be multiple reasons behind the issue —
3.1 You did not add your local SSH keys to BitBucket Settings
SSH keys could be one of the most probable reasons which are causing the issue while working with your BitBucket repository.
You might see the following errors —
or (In case you are working with mercury then you might see this error message)
How to fix?
Before we start debugging the issue, let’s first debug the issue to know the exact reason behind this error.
Run the following command from your terminal (put your correct repository name) —
The above command should return you with Username and in case you did not see your username then you need to Create SSH keys and add to your BitBucket account.
Step 2 — Goto Your Account -> Manage Account -> SSH Keys
Step 3 — Click on Add Key
Step 4 — Paste your key which you have generated in Step 1.
Step 5 — Finally click on Add Key
It should work after adding the SSH keys to your BitBucket account.
(Note — Here are some official links from bitbucket if you are interested more — click here)
3.2 Permission on your bitbucket directory
There could also be a possibility that you do not have permission to access the BitBucket repository. Check with your bitbucket administrator with regards to your permission.
If it is the case of permission then your bitbucket administrator could grant the permission.
1.1 Generate ssh-keygen on Windows 10
If you are working on a windows machine then you need to install the OpenSSH .
Goto: Apps > Apps and Features > Manage Optional Features
Verify the list of the apps, if it already installed. If not then go at the top of the page then select Add a Feature afterwords —
- OpenSSH Client : Locate OpenSSH Client , then click Install .
- OpenSSH Server : Locate OpenSSH Server , then click Install .
Install OpenSSH using PowerShell on Windows 10
If you like using Powershell then first make sure OpenSSH features are available to install —
Copy and run the following command
After that install server and client features using the following command —
1.2 Verify OpenSSH client is installed
- Goto settings panel
windows setting panel
- Click on Optional Features and then look for OpenSSH client, if you can find the OpenSSH client which means you have installed it correctly.
windows setting panel
1.3 Generate ssh keys on windows 10
- Next we need to run the ssh-keygen and for that goto window’s command prompt and open it in administrator mode.
windows command prompt administrator mode
- In the command prompt type the following command
1.4 Where to find the key pair
The file will be generated at — C:\Users\rahulwagh.ssh\id_rsa
Name of the file — id_rsa
4. How to fix(GitHub)-Support for password authentication was removed. Please use a personal access token instead
GitHub has recently announced their migration to use token-based authentication which means you can no longer use your username and password for GtiHub authentication. You need to create personal access token to continue use of your GitHub Repository.
Here is my private GitHub repository which I was trying to clone and prompted with the error message —
Support for password authentication was removed. Please use a personal access token instead
Before fixing the issue lets try to understand how do you clone your Git Repo — https:// or git@github.com
This issue is very much dependent on the way you clone your repository.
1. git@github.com:rahulwagh/jhooq.git — If you are using SSH way of cloning the repository then you will not face issue related to personal access token. Because when you use SSH way of clonning then you should always create SSH Keys and copy public SSH key to GitHub SSH and GPG keys
2. https://github.com/rahulwagh/jhooq.git — If you are using HTTPS way of cloning the Git Repository then you will be prompted with username, password and after entering the username and password you will be thrown with error Support for password authentication was removed. Please use a personal access token instead
How to fix the personal access token for GitHub Repository
- Login to your GitHub account from the web browser.
- Goto -> Profile Pic -> Setting
personal access token settings
- After that you should look on the left navigation panel and there should be an option of Developer Settings
personal access token settings developer settings
- Aftr that it will redirect you to the new page where you will find an option Personal Access Token in the left navigation. You should click on it —
personal access token click on the option
- Then next on the right side of the screen you have an option to Generate New Token —
personal access token Generate new Token
- Enter the token name along with the scopes —
personal access token enter token name and scopes
- Finally Generate Token
- Now Copy the generated Token
personal access token copy generated token
- Go back to terminal and re-issue the Git Clone command and instead of password input the access token
supply personal access token instead of GitHub password
It should fix your issue of — “Support for password authentication was removed. Please use a personal access token instead”
Can't finish github sharing process [duplicate]
I’m trying to share one of my IntelliJ projects on GitHub, but whenever I try to do that, I get an error that says it successfully created the project but initial commit failed. It gives me instructions on how to fix this, but I have no idea what the instructions mean. Can anyone decipher the error and tell me what to do?
Here is the error:
1 Answer 1
Basically, before you can create a commit, git needs to know who you are and how to refer to you. To tell git who you are, run the following commands.
Set the user name:
After that you will be able to create commits. Probably you can just rerun whatever you did that lead to this error.
IntelliJ не может поделиться проектом на GitHub (в разрешении отказано)
Я новичок в Git и GitHub / GitLab. Я пытаюсь поделиться своим проектом с GitHub, но он выдает следующее исключение:
Я также могу клонировать репозиторий через интернет-ссылку, но не через «git@github.com: / username / repository_name».
Как я могу исправить эту ошибку и могу ли я поделиться своим проектом напрямую с GitLab?
7 ответов
Я столкнулся с той же проблемой, и я сгенерировал открытый ключ для intelliJ в учетной записи github.
Настройки -> Настройки разработчика -> Личный токен доступа
Затем сгенерируйте новый токен для intelliJ, указав необходимую область действия и описание, и скопируйте ключ токена .
После этого в intelliJ выберите «Войти через токен доступа» . Войдите, вставив ключ в отображаемую форму.
Эта статья помогла мне сориентироваться в моем компьютере с Windows 10:
Примечание . Первый раздел статьи должен быть озаглавлен «Включение клиента SSH в Windows» и содержать ссылку на включение клиента SSH , не сервер.
Если вы можете заставить ssh -T git@github.com работать без запроса пароля, как описано в приведенной выше статье, тогда вы сможете отправлять сообщения из IntelliJ.
- получить службу агента аутентификации OpenSSH , работающую в Windows
- убедитесь, что вызывается ssh-add тот, который указан в C:\Windows\System32\OpenSSH
- убедитесь, что git также настроен на использование ssh, предоставляемого Windows:
git config —global core.sshCommand «‘C:\Windows\System32\OpenSSH\ssh.exe'»
При создании ключей с помощью ssh-keygen рассмотрите возможность использования алгоритма ecdsa, как описано здесь: https://www .ssh.com/ssh/keygen/
Также важно было очистить все, что пытается сделать ssh вне окон (например, Putty). Одна проблема, с которой я продолжал сталкиваться с «недопустимым форматом» при попытке запустить ssh-add , я полагаю, была вызвана другой программой ssh-add на моем пути, которая использовалась, а не той из OpenSSH, которая поставляется с Windows.
Я могу поделиться аналогичной ситуацией и ответить относительно WebStorm.
Раньше я сохранял пароль для другого ключа SSH , я добавил новый ключ (не забудьте ssh-agent -s , если, например, на Mac), но WebStorm не уловил его.
В WebStorm не указан контекст для предстоящего сообщения об ошибке, к сожалению, это общий от git :
Как упомянуто и указано в несколько, несколько проблемы на трекере IntelliJ и/или форумах JetBrains (они привели меня сюда), WebStorm (и я предполагаю, что IntelliJ тоже) использует ваш файл конфигурации SSH под капотом. Это подразумевает использование собственного клиента ssh (в предыдущих версиях Settings » Version Control » git » SSH Executable to «native» ) или использование конфигурации ( Settings » Tools » SSH Configuration s)
Таким образом, создание или редактирование вашего SSH config (например, Mac:
/.ssh/config ) для включения, например.
Затем заставит WebStorm подобрать git remote ‘s domain и запросит у вас пароль для настроенного ключа SSH/элемента конфигурации SSH.
(Не забудьте заменить заполнители, отмеченные <placeholder> выше).
Я решил это, запустив команду cat
/.ssh/id_rsa.pub, скопировал результат и в ключах Github/settings/ssh и gpg добавил «новый ключ ssh», вставил туда результат и сохранил, а затем снова запустил «git push -u origin main», и это сработало.
Я использую Windows 10 и агент аутентификации PuTTY (с защищенным паролем SSH-ключом), и это сработало для меня — для моих учетных записей Bitbucket и Github, куда я загрузил свой SSH-ключ.
- Откройте приложение «PuTTYgen».
- Нажмите «Файл > Загрузить закрытый ключ».
- Выберите файл .ppk из каталога.
- Нажмите «Конверсии > Экспорт ключа OpenSSH».
- Сохраните файл в папке «C:\Users\(ваше имя пользователя)\.ssh» с именем «id_rsa».
- Откройте Интеллидж.
- Нажмите «Файл > Настройки».
- Разверните «Контроль версий».
- Разверните «Подрывная деятельность».
- Нажмите «SSH».
- Выберите переключатель «Закрытый ключ».
- Выберите сгенерированный файл, хранящийся в папке «C:\Users\(ваше имя пользователя)\.ssh».
- Нажмите кнопку «ОК».
Это слишком общий вопрос. Требуются дополнительные сведения для уточнения.
Запустите git remote show -n origin (если вы находитесь в ветке origin . Флаг -n означает «не запрашивать удаленные устройства», что сокращает время работы для веб-запросов.), Вы можете увидеть удаленный URL.
Во многих распространенных случаях, например на GitHub, URL-адреса Git находятся в протоколах HTTPS.
Или протоколы SSH
Если поле user не принадлежит вам или одной из ваших организаций, значит, вы пытаетесь внести свой вклад в чей-то репозиторий. Пожалуйста, fork и создайте запрос на вытягивание для этого. Возможно, вам потребуется изменить удаленный URL-адрес вашего локального репо с помощью команды
Если user — это вы, то проверьте, правильно ли вы ввели свой токен.
- Если вы используете протокол HTTPS, проверьте введенное вами имя пользователя и пароль. Возможно, вам потребуется проверить учетные данные Git.
- Если вы используете протокол SSH, убедитесь, что у вас есть соответствующий SSH-ключ на вашем компьютере для GitHub. Вы можете проверить соединение с помощью команды ssh -T git@github.com .
Обновление 1. Похоже, в вашем вопросе опечатка, git@github.com:/username/repository_name . Обратите внимание на первую косую черту. Я не уверен, что это беспокоит.
Обновление 2: проверьте свои учетные данные Git, сохраните в IntelliJ IDEA в File -> Settings -> Version Control -> GitHub
Обновление 3: вы также можете поделиться им с GitLab, просто добавьте один пульт, например выполните команду git remote add gitlab <url> .