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:
Can't finish GitHub sharing process Successfully created project 'basic-program' on GitHub, but initial commit failed: *** Please tell me who you are. Run git config --global user.email "[email protected]" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository. unable to auto-detect email address (got 'Owner@****.(none)')
asked Feb 23, 2021 at 21:21
35 1 1 silver badge 6 6 bronze badges
Have you tried running the command from the error message (i.e. git config . )?
Feb 23, 2021 at 21:40
Please include the error message as text next time and add the picture ogtionally for clarification. That way other people will be able to find your Question and the answers when they search for the exact error.
Feb 23, 2021 at 22:39
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:
git config --global user.name "Firstname Lastname"
After that you will be able to create commits. Probably you can just rerun whatever you did that lead to this error.
Further reference for git config command
—global will make every git repository on your local machine for the current user use this (e.g. user.name) value. Overrides system config if this value is set.
—local (or just nothing, since this is the default) will make only the current git repository on your local machine use this (e.g. user.name) value. Overrides global and system config if this value is set.
—system will make every git repository on your local machine for all users use this (e.g. user.name) value.
Как исравить ошибку Phpstorm при расшаривании проекта на github — Successfully created project on GitHub, but initial push failed?
Создал пробный аккаунт в Github, и получилось из Phpstorm создать приватный репозиторий и залить проект. Но!
Решил перекинуть проект на свой рабочий аккаунт github и тут начали возникать сюрпризы:
При расшаривании приватного проекта — проект создается, но не заливается, пишет ошибку:
Can't finish GitHub sharing process Successfully created project 'test-007' on GitHub, but initial push failed: repository 'https://github.com/user-name/test-007.git/' not found
Как это исправить, что делаю не так?
- Вопрос задан более трёх лет назад
- 123 просмотра
Git error push
Здравствуйте. Не нашёл соответствующей ветки, поэтому кинул сюда. Посоветуйте пожалуйста, проблема вот в чём. У меня стоит intellij Idea, скачал GIt. У идеи есть интеграция с Git. Установил в настройках host,login,passsword. Файлы не пушатся файлы! Push failed
Failed with error: fatal: unable to access ‘https://github.com/AndreiGrigorenko/kursBdGrigorenko.git/’: The requested URL returned error: 403
Лучшие ответы ( 1 )
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
Ответы с готовыми решениями:
fatal: Not a git repository (or any of the parent directories): .git
Подключил EGit для разработки командных проектов . Теперь при запуске программ хранящихся на.

Git Bitbucket push на существующий репозиторий
Суть в чем на домашнем ПК, есть проект который был скачан в виде архива, сейчас его нужно пушнуть.

Error: failed to push some refs (Git)
Попытался выложить свой первый проект на GitHub, но возникает магическая ошибка. Все делал в.
git push
Есть репозиторий на битбакет в который ранее пушили, нужно создать бранч. Есть локальная папка.
944 / 687 / 230
Регистрация: 28.04.2013
Сообщений: 1,926
vifelso,
Сообщение от vifelso 
AndreiGrigorenko
это ваш аккаунт?
Добавлено через 4 минуты
в папке пользователя есть файл .gitconfig
внутри него
name = AndreiGrigorenko
Регистрация: 06.11.2014
Сообщений: 346
так в .gitconfig установил что нужно, теперь это ошибка вылезла:
Can’t add remote
fatal: remote github already exists. during executing git -c core.quotepath=false remote add github https://github.com/vifelso/KursBdAnnotation.git
Добавлено через 2 минуты
в .gitconfig стоит имя и емайл
Добавлено через 1 минуту
reisal78, Не подскажите как это исправить?
Добавлено через 2 минуты
и вот такая ещё :
Can’t finish GitHub sharing process
Successfully created project ‘Game-intuition’ on GitHub, but initial commit failed: *** Please tell me who you are. Run git config —global user.email «you@example.com» git config —global user.name «Your Name» to set your account’s default identity. Omit —global to set the identity only in this repository. fatal: unable to auto-detect email address (got ‘Andrei@Andrei.(none)’) during executing git -c core.quotepath=false commit -m «Initial commit» —
Добавлено через 3 минуты
Я уже всё перепробовал, ковырялся в настройках идеи, удалял и заного ставил Git, очищал кеш идеи. Ничего не помогает
Removing sensitive data from a repository
If you commit sensitive data, such as a password or SSH key into a Git repository, you can remove it from the history. To entirely remove unwanted files from a repository’s history you can use either the git filter-repo tool or the BFG Repo-Cleaner open source tool.
The git filter-repo tool and the BFG Repo-Cleaner rewrite your repository’s history, which changes the SHAs for existing commits that you alter and any dependent commits. Changed commit SHAs may affect open pull requests in your repository. We recommend merging or closing all open pull requests before removing files from your repository.
You can remove the file from the latest commit with git rm . For information on removing a file that was added with the latest commit, see «About large files on GitHub.»
Warning: This article tells you how to make commits with sensitive data unreachable from any branches or tags in your repository on GitHub.com. However, those commits may still be accessible in any clones or forks of your repository, directly via their SHA-1 hashes in cached views on GitHub, and through any pull requests that reference them. You cannot remove sensitive data from other users’ clones of your repository, but you can permanently remove cached views and references to the sensitive data in pull requests on GitHub by contacting us through the GitHub Support portal. GitHub Support only assists in the removal of sensitive data in cases where we determine that the risk can’t be mitigated by rotating affected credentials.
Once you have pushed a commit to GitHub, you should consider any sensitive data in the commit compromised. If you have committed a password, you should change it. If you have committed a key, generate a new one. Removing the compromised data doesn’t resolve its initial exposure, especially in existing clones or forks of your repository.
If the commit that introduced the sensitive data exists in any forks of your repository, it will continue to be accessible unless the fork owner also removes the sensitive data from their fork or deletes the fork entirely. You will need to coordinate with the owners of any forks of your repository, asking them to take the appropriate actions. Please note that GitHub cannot provide contact information for these owners.
Consider these limitations and challenges in your decision to rewrite your repository’s history.
Purging a file from your repository’s history
You can purge a file from your repository’s history using either the git filter-repo tool or the BFG Repo-Cleaner open source tool.
Note: If sensitive data is located in a file that’s identified as a binary file, you’ll need to remove the file from the history, as you can’t modify it to remove or replace the data.
Using the BFG
The BFG Repo-Cleaner is a tool that’s built and maintained by the open source community. It provides a faster, simpler alternative to git filter-repo for removing unwanted data.
For example, to remove your file with sensitive data and leave your latest commit untouched, run:
bfg --delete-files YOUR-FILE-WITH-SENSITIVE-DATA
To replace all text listed in passwords.txt wherever it can be found in your repository’s history, run:
bfg --replace-text passwords.txt
After the sensitive data is removed, you must force push your changes to GitHub. Force pushing rewrites the repository history, which removes sensitive data from the commit history. If you force push, it may overwrite commits that other people have based their work on.
git push --force
See the BFG Repo-Cleaner’s documentation for full usage and download instructions.
Using git filter-repo
Warning: If you run git filter-repo after stashing changes, you won’t be able to retrieve your changes with other stash commands. Before running git filter-repo , we recommend unstashing any changes you’ve made. To unstash the last set of changes you’ve stashed, run git stash show -p | git apply -R . For more information, see Git Tools — Stashing and Cleaning.
To illustrate how git filter-repo works, we’ll show you how to remove your file with sensitive data from the history of your repository and add it to .gitignore to ensure that it is not accidentally re-committed.
-
Install the latest release of the git filter-repo tool. You can install git-filter-repo manually or by using a package manager. For example, to install the tool with HomeBrew, use the brew install command.
brew install git-filter-repo
$ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY > Initialized empty Git repository in /Users/YOUR-FILE-PATH/YOUR-REPOSITORY/.git/ > remote: Counting objects: 1301, done. > remote: Compressing objects: 100% (769/769), done. > remote: Total 1301 (delta 724), reused 910 (delta 522) > Receiving objects: 100% (1301/1301), 164.39 KiB, done. > Resolving deltas: 100% (724/724), done.
cd YOUR-REPOSITORY
- Force Git to process, but not check out, the entire history of every branch and tag
- Remove the specified file, as well as any empty commits generated as a result
- Remove some configurations, such as the remote URL, stored in the .git/config file. You may want to back up this file in advance for restoration later.
- Overwrite your existing tags
$ git filter-repo --invert-paths --path PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA Parsed 197 commits New history written in 0.11 seconds; now repacking/cleaning. Repacking your repo and cleaning out old unneeded objects Enumerating objects: 210, done. Counting objects: 100% (210/210), done. Delta compression using up to 12 threads Compressing objects: 100% (127/127), done. Writing objects: 100% (210/210), done. Building bitmaps: 100% (48/48), done. Total 210 (delta 98), reused 144 (delta 75), pack-reused 0 Completely finished after 0.64 seconds.
Note: If the file with sensitive data used to exist at any other paths (because it was moved or renamed), you must run this command on those paths, as well.
$ echo "YOUR-FILE-WITH-SENSITIVE-DATA" >> .gitignore $ git add .gitignore $ git commit -m "Add YOUR-FILE-WITH-SENSITIVE-DATA to .gitignore" > [main 051452f] Add YOUR-FILE-WITH-SENSITIVE-DATA to .gitignore > 1 files changed, 1 insertions(+), 0 deletions(-)
git remote add origin https://github.com/OWNER/REPOSITORY.git
$ git push origin --force --all > Counting objects: 1074, done. > Delta compression using 2 threads. > Compressing objects: 100% (677/677), done. > Writing objects: 100% (1058/1058), 148.85 KiB, done. > Total 1058 (delta 590), reused 602 (delta 378) > To https://github.com/YOUR-USERNAME/YOUR-REPOSITORY.git > + 48dc599. 051452f main -> main (forced update)
$ git push origin --force --tags > Counting objects: 321, done. > Delta compression using up to 8 threads. > Compressing objects: 100% (166/166), done. > Writing objects: 100% (321/321), 331.74 KiB | 0 bytes/s, done. > Total 321 (delta 124), reused 269 (delta 108) > To https://github.com/YOUR-USERNAME/YOUR-REPOSITORY.git > + 48dc599. 051452f main -> main (forced update)
Fully removing the data from GitHub
After using either the BFG tool or git filter-repo to remove the sensitive data and pushing your changes to GitHub, you must take a few more steps to fully remove the data from GitHub.
-
Contact us through the GitHub Support portal, and ask to remove cached views and references to the sensitive data in pull requests on GitHub. Please provide the name of the repository and/or a link to the commit you need removed.
Note: GitHub Support won’t remove non-sensitive data, and will only assist in the removal of sensitive data in cases where we determine that the risk can’t be mitigated by rotating affected credentials.
$ git for-each-ref --format="delete %(refname)" refs/original | git update-ref --stdin $ git reflog expire --expire=now --all $ git gc --prune=now > Counting objects: 2437, done. > Delta compression using up to 4 threads. > Compressing objects: 100% (1378/1378), done. > Writing objects: 100% (2437/2437), done. > Total 2437 (delta 1461), reused 1802 (delta 1048)
Note: You can also achieve this by pushing your filtered history to a new or empty repository and then making a fresh clone from GitHub.
Avoiding accidental commits in the future
Preventing contributors from making accidental commits can help you prevent sensitive information from being exposed. For more information see «Best practices for preventing data leaks in your organization.»
There are a few simple tricks to avoid committing things you don’t want committed:
- Use a visual program like GitHub Desktop or gitk to commit changes. Visual programs generally make it easier to see exactly which files will be added, deleted, and modified with each commit.
- Avoid the catch-all commands git add . and git commit -a on the command line—use git add filename and git rm filename to individually stage files, instead.
- Use git add —interactive to individually review and stage changes within each file.
- Use git diff —cached to review the changes that you have staged for commit. This is the exact diff that git commit will produce as long as you don’t use the -a flag.
Further reading
- git filter-repo man page
- Pro Git: Git Tools — Rewriting History
- «About secret scanning»