Git did not exit cleanly exit code 1 как исправить

I got this message when i tried to create repository by using Git clone.

git did not exit cleanly (exit code 1)

How to fix this?

CodeWizard's user avatar

CodeWizard

125k21 gold badges141 silver badges163 bronze badges

asked Mar 4, 2014 at 7:50

Nevaeh's user avatar

6

Try these two commands in git bash:

1) git gc --force

2) git fetch -p

Suresh Karia's user avatar

Suresh Karia

17.2k18 gold badges67 silver badges85 bronze badges

answered Nov 27, 2015 at 6:28

Sahadevan's user avatar

SahadevanSahadevan

3313 silver badges2 bronze badges

0

Right-click folder -> TortiseGit -> push-> choose unknown changes 》

sandip's user avatar

sandip

5439 silver badges27 bronze badges

answered Mar 29, 2018 at 15:32

陈先生's user avatar

陈先生陈先生

911 silver badge2 bronze badges

1

Right from my experience, I most often get this when I have locally changed files that will be over ridden by the pull, you need to stash or move the files before you can pull it.

answered Jan 4, 2016 at 8:13

RenScorch's user avatar

RenScorchRenScorch

811 silver badge2 bronze badges

Sometimes it happens because of incomplete of some operations such as “stash save”. It creates an index.lock file in the .git folder and that causes this error. What you need to do is going in to the .git folder and delete index.lock file and restart what you wanted to do.

The .git Folder

The index.lock File

answered Dec 15, 2016 at 8:00

Syed Mobarak's user avatar

  1. Right-click > Revert > Select All
  2. Click OK;
  3. After Revert process is finished, PULL.

Problem solved!

Patrick's user avatar

Patrick

5,37412 gold badges61 silver badges99 bronze badges

answered Sep 4, 2017 at 9:38

Natther Shah's user avatar

2

Right click -> TortoiseGit -> Settings -> Network
SSH client was pointing to C:Program FilesTortoiseGitbinTortoisePlink.exe
Changed path to C:Program Files (x86)Gitbinssh.exe

answered Apr 27, 2015 at 13:37

eric more's user avatar

2

Actually, this error message just says that there is some problem but no specifications of the problem. So, in my case, it was a pending pull request. I pulled the changes into my repo, and then pushed it again and it worked. Moreover, if there is an error on tortoisegit, I prefer to do the same on console. Console gives more detail error message

answered Oct 12, 2015 at 14:11

user3050590's user avatar

user3050590user3050590

1,6364 gold badges21 silver badges40 bronze badges

Following this guide I had the same issue. To expand on Eric Moore’s ridiculously vague answer,

Right click > TortoiseGit > Settings > Network

Down the bottom in the “SSH” section, hit Browse and find your TortoiseGitbinTortoisePlink.exe file. In my case the path was under Programs as opposed to Program Files

answered Sep 21, 2015 at 8:03

Abraham Brookes's user avatar

Abraham BrookesAbraham Brookes

1,7101 gold badge16 silver badges32 bronze badges

I was heard that, one of the reasons is , the project is too large, so increasing the post buffer could solve the problem.
so open the editSystemWideGitConfig, and add the following statements under [http] , postBuffer = 524288000.
maybe work.

answered Oct 10, 2016 at 3:51

lynn's user avatar

1

For me it was due to insufficient disk space , and it was resolved after I freed up some disk space on my local drive.

answered Apr 10, 2018 at 14:37

Reza Iranpour's user avatar

Actually, the easiest way to determine the error is to use ‘Git Sync …’ then perform a pull/push from there – the error message is far more meaningful (i.e. there is one) and at least in my case, my -1 was due to a network path issue

answered Nov 23, 2015 at 20:47

schlock's user avatar

schlockschlock

5093 gold badges5 silver badges14 bronze badges

I ran into the same issue after upgrading Git. Turns out I switched from 32-bit to 64-bit Git and I didn’t realize it. TortoiseGit was still looking for “C:Program Files (x86)Gitbin”, which didn’t exist. Right-click the folder, go to Tortoise Git > Settings > General and update the Git.exe path.

answered Apr 17, 2016 at 23:13

Michael Flanakin's user avatar

This is Just because you have made changes on your remote repository which was not pulled on your local repository.

To resolve simply
1. Pull from remote repository to local repository. It will not undo any changes locally. It will just update local repository.
2. Now push the changes to remote repository. It will work

answered Jul 29, 2016 at 12:28

Abhishek Maurya's user avatar

Abhishek MauryaAbhishek Maurya

3111 gold badge3 silver badges13 bronze badges

For My case i did 3 steps to achieve the sucessful build.

  1. revert all the local changes if any (or just keep a copy of it in case you need it for future use)

  2. Do a git clean up, do a pull and check the logs for error

  3. GO to the git bash option and the error i was getting in log in above stem (i my case )
    as “error: cannot lock ref and the branch details“, so in the git bash i ran the following command
    git update-ref -d ‘Branch_name’

For example if the error was something like
**

  • ISSUE

**error: cannot lock ref ‘refs/remotes/origin/EXMPLEISSUE/EXAMPLE-1011_DEMO_web_interface_DOES_NOT_GET_GIT_UPDATE’:

Then i ran following command
git update-ref -d ‘refs/remotes/origin/EXMPLEISSUE/EXAMPLE-1011_DEMO_web_interface_DOES_NOT_GET_GIT_UPDATE’

We have to ensure all the error in logs to be solved similarly before getting a successful pull by doing git update-ref -d ‘Branch_name’ and finally i can get the take the successful pull from git.

answered Jul 19, 2018 at 9:54

Aashish Mukherjee's user avatar

My Git account started having problems right after I changed my email address (my work email changed). I tried everything I could, uninstalling, reinstalling, spending time on the phone with git helpdesk, etc.

Gave up and created a new email address and new account, but still kept getting ‘did not exit cleanly‘ message.

How I resolved was: uninstall everything git related, remove all references to anything git including tortoise under appdata, delete all git folders under Program Files and Program Files (x86), remove Window Credentials (Credential Manager in Control Panel) for all things git, reboot, reinstall with new account.

answered Feb 6, 2019 at 18:32

LionDog823's user avatar

first login on git then before push take the pull. issue will be resolved

answered Jul 3, 2019 at 7:05

Saurabh's user avatar

SaurabhSaurabh

4225 silver badges6 bronze badges

I have faced this situation and in my case, I was using two git id’s simultaneously. so what it does it will update the credentials in the credential Manager

Control PanelUser AccountsCredential Manager

as shown here

inside Credential Manager, you will find the git hub credentials inside the Generic credentials there you have to update your git credentials.

marcolz's user avatar

marcolz

2,8202 gold badges23 silver badges27 bronze badges

answered Sep 26, 2019 at 6:28

bipin kumar's user avatar

I also encountered this error message due to longpath issues. Try to input this, that’s helpful for me.

git config --global core.longpaths true

answered Jan 14, 2020 at 3:09

Mystic Lin's user avatar

Mystic LinMystic Lin

3654 silver badges15 bronze badges

I removed the repo and then recloned it. Then the problem is solved. Ensure your unpushed files are well backed up before you do so though.

answered Jun 22, 2021 at 11:25

vickyhella's user avatar

Just check your branch name in remote and local hope there may be a case-related miss-match .

answered Jul 13, 2021 at 6:53

SK AMINUL ISLAM's user avatar

  • Go to the project folder.
  • open .git folder
    .git=>refs=>remotes=> Delete the origin folder

Finally do pull/Push. It will work.

Rachid K.'s user avatar

Rachid K.

4,3503 gold badges10 silver badges30 bronze badges

answered Sep 14, 2022 at 11:10

Prithivirajan's user avatar

Right-click folder -> TortiseGit -> Clean up.. -> click OK

None of the above solutions worked for me but this one did.

answered Feb 22, 2016 at 20:28

tyrol37's user avatar

1

to work just use force during push

answered Mar 30 at 20:30

Ariful's user avatar

ArifulAriful

131 gold badge1 silver badge5 bronze badges

1

Долбаный ГИТ.
Несколько приемов, которыми придется пользоваться по ходу работы с ним.

1. Ключи
Чтобы можно было синхронизировать локальный репозиторий с репозиторием на ГИТе, необходимо обзавестись парой ключей – публичным и приватным.
  а. Публичный ключ
В состав TurtoiseGit входит утилита PuttyGen. Запустив ее и поводив пару раз мышкой по монитору мы генерим ssh-rsa публичный ключ. Этот ключ надо ввести в свойствах аккаунта на сервере Git.
  б. Приватный ключ
После того, как публичный ключ введен на сайте, мы возвращаемся в PuttyGen и сохраняем приватный ключ, предварительно придумав к нему какой-то пароль.
  в. Настройка TurtoiseGit
Открываем свойства папки, которая у нас является локальным репозиторием GIT на компе. Settings->Git->Remote. В нем указываем произольное имя для удаленного репозитория на сервере GIT, с которым мы будем синхронизироваться, в URL вставляем ссылку на проект (git@github.com:Mblztr/Information.git, например), и в PuttyKey вставляем путь до приватного ключа из пункта Б.

Все с ключами разобрались.

2. Ошибка “git did not exit cleanly (exit code 1)”

После изменений какого-то файла в локальном репозитории, после коммита, при попытке сделать Push на сервер у меня в течение всего вечера выскакивала долбаная ошибка git did not exit cleanly (exit code 1). Потеряв 2 часа на изменение настроек ключей, и плюнув в монитор, решил отложить до завтра. Как оказалось не зря.
Порядок решения следующий:
1. Коммитится изменение над файлом
2. Get Sync для папки, в которой он находится
2. Pull
3. Push изменения файла

Вуаля!

3. Для сборки проекта с GIT по средствам phing

phing должен быть установлен.
Нужно сгенерировать ключи для того пользователя, под которым запускается phing и прописать их в свойствах аккаунта на сайте.
Статья на эту тему здесь: https://help.github.com/articles/generating-ssh-keys#platform-linux
Приведу описание:
а. проверим наличие ключей для текущего пользователя в домашней папке

cd ~/.ssh

если папка есть – отлично, следующий пункт можно пропустить.
если нет – дальше.
симптом того, что ключа нет будет следующая запись при попытке сборки:

The remote end hung up un

Total time: 10.5752 seconds

б. генерим новый ключ, введя адрес своей почты

ssh-keygen -t rsa -C "your_email@example.com"# Creates a new ssh key using the provided email
# Generating public/private rsa key pair.
# Enter file in which to save the key (/home/you/.ssh/id_rsa):

соглашаемся на стандартное имя, вводим пароль от ключа и получаем следующее:

our identification has been saved in /home/you/.ssh/id_rsa.
# Your public key has been saved in /home/you/.ssh/id_rsa.pub.
# The key fingerprint is:
# 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com

в. в любом редакторе открываем файл /.ssh/id_rsa.pub
    и копируем его содержимое в настройки аккаунта на github.com d раздел ssh keys

г. готово, теперь можем в консоли сервера набрать что-то типа:  phing -f /home/sop/backoffice/backoffice.xml -Dgit.tag=1.0.32
    и собрать проект.
    у пользователя, которым запускается команда должны быть права на запись в папку, откуда запускается команда!

4. Клонирование удаленного репозитория c TortoiseGit

У репозитория есть адрес, к примеру: git@github.com:Mblztr/OldArchives.git

Чтобы склонировать его на локальную машину надо в контекстном меню проводника (где-то в белом поле, шелкнув правой) выбрать GIT Clone, вбить SSH адрес (git@github.com:Mblztr/OldArchives.git), выбрать папку куда его клонировать, вписать закрытый ключ (пункт 1 этой статьи).

Чтобы добавить папку в репозиторий, нужно выбрать контекстное меню папки TurtoiseGIT -> Add
Закачать изменения к себе локально – Pull
Выложить изменения на сервер – Push

Из статьи: http://habrahabr.ru/post/125799/

Я получил это сообщение, когда попытался создать репозиторий с помощью Git clone.

git did not exit cleanly (exit code 1)

Как это исправить?

4b9b3361

Ответ 1

Попробуйте выполнить эти две команды в git bash:

1) git gc --force

2) git fetch -p

Ответ 2

С самого начала, я чаще всего получаю это, когда я локально меняю файлы, которые будут перегружены приложением, вам нужно занести или переместить файлы, прежде чем вы сможете их вытащить.

Ответ 3

Иногда это происходит из-за неполных операций, таких как “сохранение закладок”. Он создает файл index.lock в папке .git и вызывает эту ошибку. Что вам нужно сделать, это зайти в папку .git и удалить файл index.lock и перезапустить то, что вы хотели сделать.

Папка .git

Файл index.lock

Ответ 4

Щелкните правой кнопкой мыши папку -> TortiseGit -> push-> выберите неизвестные изменения》

Ответ 5

Right click -> TortoiseGit -> Settings -> Network
SSH client was pointing to C:Program FilesTortoiseGitbinTortoisePlink.exe
Changed path to C:Program Files (x86)Gitbinssh.exe

Ответ 6

  • Щелкните правой кнопкой мыши > Восстановить > Выбрать все
  • Нажмите “ОК”;
  • После завершения процесса возврата PULL.

Проблема решена!

Ответ 7

Собственно, это сообщение об ошибке просто говорит, что есть какая-то проблема, но нет спецификаций проблемы. Таким образом, в моем случае это был ожидающий запрос на растяжение. Я вложил изменения в свое репо, а затем снова нажал на него, и это сработало. Более того, если на черепахе есть ошибка, я предпочитаю делать то же самое на консоли. Консоль дает более подробное сообщение об ошибке

Ответ 8

Следуя это руководство У меня была такая же проблема. Расширить на Эрика Мура смехотворно неопределенный ответ,

Right click > TortoiseGit > Settings > Network

Внизу в разделе “SSH” нажмите “Обзор” и найдите файл TortoiseGitbinTortoisePlink.exe. В моем случае путь находился под Programs в отличие от Program Files

Ответ 9

Щелкните правой кнопкой мыши папку → TortiseGit → Очистить.. → нажмите OK

Ни одно из вышеперечисленных решений не работало для меня, но это делалось.

Ответ 10

Я слышал, что одна из причин заключается в том, что проект слишком велик, поэтому увеличение почтового буфера может решить проблему.
поэтому откройте editSystemWideGitConfig и добавьте следующие инструкции в [http], postBuffer = 524288000.
возможно, работает.

Ответ 11

На самом деле, самый простой способ определить ошибку – использовать ‘Git Sync…’, затем выполнить pull/push отсюда – сообщение об ошибке гораздо более значимо (т.е. есть одно) и, по крайней мере, в мой случай, мой -1 был связан с проблемой сетевого пути

Ответ 12

Я столкнулся с тем же вопросом после обновления Git. Оказывается, я переключился с 32-битного на 64-битный Git, и я этого не понимал. TortoiseGit все еще искал “C:Program Files (x86)Gitbin”, которого не было. Щелкните правой кнопкой мыши папку, перейдите в Tortoise Git > Настройки > Общие и обновите путь Git.exe.

Ответ 13

Это просто потому, что вы внесли изменения в свой удаленный репозиторий, который не был вынут из вашего локального репозитория.

Чтобы разрешить просто
1. Извлеките удаленный репозиторий в локальный репозиторий. Он не отменяет никаких изменений на локальном уровне. Он просто обновит локальный репозиторий.
2. Теперь переместите изменения в удаленный репозиторий. Он будет работать

Ответ 14

Для меня это было из-за недостатка дискового пространства, и это было решено после того, как я освободил место на моем локальном диске.

Ответ 15

Для моего случая я сделал 3 шага, чтобы добиться успешной сборки.

  1. отменить все локальные изменения, если они есть (или просто сохранить их копию на случай, если она понадобится вам в будущем)

  2. Сделайте git очистить, сделать тянуть и проверить журналы на наличие ошибок

  3. Перейдите к параметру git bash и к ошибке, которую я получаю в журнале регистрации выше (в моем случае) как ” ошибка: невозможно заблокировать ref и детали ветвления “, поэтому в git bash я выполнил следующую команду git update-ref [ CN00] ‘Branch_name’

Например, если ошибка была что-то вроде **

  • ВОПРОС

** ошибка: невозможно заблокировать ref ‘refs/remotes/origin/EXMPLEISSUE/EXAMPLE-1011_DEMO_web_interface_DOES_NOT_GET_GIT_UPDATE’:

Затем я выполнил следующую команду git update-ref -d ‘refs/remotes/origin/EXMPLEISSUE/EXAMPLE-1011_DEMO_web_interface_DOES_NOT_GET_GIT_UPDATE’

Мы должны убедиться, что все ошибки в журналах должны быть устранены аналогичным образом, прежде чем получить успешное извлечение, выполнив git update-ref -d ‘Branch_name’ и, наконец, я смогу получить успешное извлечение из git.

Ответ 16

В моей учетной записи Git начались проблемы сразу после того, как я сменил адрес электронной почты (изменился рабочий адрес). Я перепробовал все, что мог, удаление, переустановку, тратить время на телефон с помощью git helpdesk и т.д.

Дали и создали новый адрес электронной почты и новую учетную запись, но все равно продолжали получать сообщение ” не вышел чисто “.

Я решил: удалите все, что связано с git, удалите все ссылки на все git, включая черепаху, в appdata, удалите все папки git в Program Files и Program Files (x86), удалите учетные данные окна (Диспетчер учетных данных в панели управления) для всех вещей git, перезагрузите, переустановите с новой учетной записью.

Ответ 17

Сначала войдите в Git, а затем, прежде чем нажать, возьмите пулл. проблема будет решена

Ответ 18

Я сталкивался с этой ситуацией, и в моем случае я использовал два git ID одновременно. так что он будет обновлять учетные данные в диспетчере учетных данных

Control PanelUser AccountsCredential Manager

как показано here

внутри диспетчера учетных данных вы найдете учетные данные git-хаба внутри общих учетных данных, где вы должны обновить свои учетные данные git.

The error message “git did not exit cleanly (exit code 1)” is a very general error message, in most of scenarios, just clean up local repository to resolve it, but sometimes it not actully caused by “not clean”.

In my case, the reason is I tried to push large file that size over the postbuffer (default as 1M).

Solution

Edit .gitconfig, set http.postBuffer to larger amout.

  1. Set post buffer to 10M :
    git config --global http.postBuffer 102400
  2. Check result :
    By command git config --global --list or open global wide .gitconfig file to check, will recored as below

    [http]
    	postBuffer = 102400
    

Reference

TortoiseGit-git did not exit cleanly (exit code 1)

[pro test effective] git did not exit cleanly (exit code 1) solution

Solution to git did not exit cleanly(exit code 1) during git upload

**git did not exit cleanly(exit code 1)** exception reminder.

Solution: At this point we can create a new repository in git, clone it to the local, and then upload the file you want to upload according to git upload.


Then upload it to success.


At this point in the newly created repository in git, there is already a file you want to upload.

Intelligent Recommendation

git did not exit cleanly

exit code 1 Change 2 and 3, submit an error once, then change it back and submit it will be normal   exit code 128 There is a problem with github, pull and push, prompt git did not exit cleanly (…

More Recommendation

Добавить комментарий