Error key does not contain a section user

I recently transferred a git repository to a new organization. I ran the following: git remote set-url origin https://github.com/organizationname/therepo.git I am successfully pulling/pushing fro...

I recently transferred a git repository to a new organization. I ran the following:

git remote set-url origin https://github.com/organizationname/therepo.git

I am successfully pulling/pushing from the new location. But now getting the following errors every time I run a git command:

error: key does not contain a section: repositoryformatversion
error: key does not contain a section: filemode
error: key does not contain a section: bare
error: key does not contain a section: logallrefupdates
error: key does not contain a section: ignorecase
error: key does not contain a section: precomposeunicode

I initially thought it had to do with my config file however those fields are present. The first lines of My /.git/config file looks like this:

repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true

In this answer it suggests to check for --get-regex but I do not see any reference to that in my config or .gitconfig files. It looks like I have 2 git config files:

/usr/local/git/etc/gitconfig

and:

/Users/chmd/.gitconfig

I tried adding those keys to /Users/chmd/.gitconfig file with no such luck. What step am I missing to clear out these errors? Based on previous answer and research it seems to be my config, but I’m including those fields in my gitconfig?

Я недавно перенес git-репозиторий в новую организацию. Я запустил следующее:

git remote set-url origin https://github.com/organizationname/therepo.git

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

error: key does not contain a section: repositoryformatversion
error: key does not contain a section: filemode
error: key does not contain a section: bare
error: key does not contain a section: logallrefupdates
error: key does not contain a section: ignorecase
error: key does not contain a section: precomposeunicode

Сначала я думал, что это связано с моим файлом конфигурации, однако эти поля присутствуют. Первые строки файла My /.git/config выглядят так:

repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true

В этом ответе предлагается проверить --get-regex, но Я не вижу ссылки на это в моих файлах конфигурации или .gitconfig. Похоже, у меня есть 2 файла конфигурации git:

/usr/local/git/etc/gitconfig

И:

/Users/chmd/.gitconfig

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

4 ответа

Лучший ответ

Действительно, проблема в .git/config. Вы, вероятно, отредактировали его и по ошибке удалили название раздела.

Значения в конфигурационном файле Git сгруппированы по разделам. Название каждого раздела помещается в квадратные скобки на отдельной строке.

Отправленные вами значения (с начала вашего .git/config) должны оставаться в разделе core. Сделайте ваш .git/config файл похожим на:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ...


13

axiac
18 Июл 2017 в 18:18

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

error: key does not contain a section: name
error: key does not contain a section: email

Оказывается, я что-то напутал в моем ~/.gitconfig файле.

Чтобы исправить это, я посмотрел этот пример и понял, что первый раздел этого файла должен выглядеть следующим образом это (поддельные данные примера):

[user]
    name = Bart S
    email = bart.s@example.com
    username = barts

Это исправило это для меня.


0

Bart S
3 Июн 2020 в 19:53

вставьте следующий код в терминал, он откроет глобальный файл конфигурации в текстовом редакторе VI

git config --global --edit

Нажмите i, чтобы написать в текстовом редакторе VI, удалить весь текст и вставить следующее

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true

Чтобы сохранить в VI нажмите ESC и: wq и нажмите ввод


4

khem raj regmi
13 Сен 2018 в 11:39

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner

4,467,937

Community Members

  • Community
  • Products
  • Bitbucket
  • Questions
  • Can’t get past error message when trying to git global config username

Kris Lyle

Trying to configure global user name and email but keep getting the same error message:

  • error: key does not contain a section: name
  • error: key does not contain a section: email

What am I missing? 

I’m on a Macbook Air (Mojave) using Terminal. 

3 answers

1 accepted

Tyler T

Check the contents of the file:

cat ~/.gitconfig

The format should look something like:

[user]
name = Firstname Lastname
email = name@example.com
[core]
etc....

As @Jobin Kuruvilla [Adaptavist] suggested, it might be malformed and need manual updating.

You must be a registered user to add a comment. If you’ve already registered, sign in. Otherwise, register and sign in.

  • Comment

Kris Lyle

There were some lines that I had to delete in the gitconfig file (i.e. two empty, two with an outdated username and email).

Thank you!

You must be a registered user to add a comment. If you’ve already registered, sign in. Otherwise, register and sign in.

  • Comment

Jobin Kuruvilla [Adaptavist]

You must be a registered user to add a comment. If you’ve already registered, sign in. Otherwise, register and sign in.

  • Comment

xgqfrms

[user] + [core]

# inner local project

$ vim .git/config

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true

[user]
name = xgqfrms
email = xgqfrms@ufo.com

$ cat .git/config

You must be a registered user to add a comment. If you’ve already registered, sign in. Otherwise, register and sign in.

  • Comment

xgqfrms

$ vim ~/.gitconfig

# email = xgqfrms@ufo.com
# name = xgqfrms

[user]
  email = xxx@xxx.com
  name = xgqfrms

$ cat ~/.gitconfig

You must be a registered user to add a comment. If you’ve already registered, sign in. Otherwise, register and sign in.

  • Comment

Suggest an answer

People on a hot air balloon lifted by Community discussions

Still have a question?

Get fast answers from people who know.

Was this helpful?

Thanks!

Atlassian Community Events

  • FAQ
  • Community Guidelines
  • About
  • Privacy policy
  • Terms of use
  • © 2023 Atlassian

paste the following code to terminal it will open global config file in VI text editor

git config --global --edit

press i to write in VI text editor and remove all the text and paste the following

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true

to save in VI press ESC and :wq and press enter

This is not your case, but responding here for other people with the same issue as me. I had this error message:

error: key does not contain a section: name
error: key does not contain a section: email

It turns out I had messed up something in my ~/.gitconfig file.

To fix it, I looked at this example and realized the first section of that file should look like this (fake example data):

[user]
    name = Bart S
    email = [email protected]
    username = barts

This fixed it for me.

Indeed, the problem is in .git/config. You probably edited it and you removed the name of the section by mistake.

The values in Git config file are grouped in sections. The name of each section is placed between square brackets on a separate line.

The values you posted (from the beginning of your .git/config) should stay in the core section. Make your .git/config file look like:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ...

Git configuration is organized in sections.

It’s:

  • core.repositoryformatversion
  • core.filemode
  • color.ui

Your .git/config should look like this:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    # ...

I recently transferred a git repository to a new organization. I ran the following:

git remote set-url origin https://github.com/organizationname/therepo.git

I am successfully pulling/pushing from the new location. But now getting the following errors every time I run a git command:

error: key does not contain a section: repositoryformatversion
error: key does not contain a section: filemode
error: key does not contain a section: bare
error: key does not contain a section: logallrefupdates
error: key does not contain a section: ignorecase
error: key does not contain a section: precomposeunicode

I initially thought it had to do with my config file however those fields are present. The first lines of My /.git/config file looks like this:

repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true

In this answer it suggests to check for --get-regex but I do not see any reference to that in my config or .gitconfig files. It looks like I have 2 git config files:

/usr/local/git/etc/gitconfig

and:

/Users/chmd/.gitconfig

I tried adding those keys to /Users/chmd/.gitconfig file with no such luck. What step am I missing to clear out these errors? Based on previous answer and research it seems to be my config, but I’m including those fields in my gitconfig?


Indeed, the problem is in .git/config. You probably edited it and you removed the name of the section by mistake.

The values in Git config file are grouped in sections. The name of each section is placed between square brackets on a separate line.

The values you posted (from the beginning of your .git/config) should stay in the core section. Make your .git/config file look like:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ...


  1. Home


  2. Software Programming


  3. GIT error: key does not contain a section: user-mail

This topic has been deleted. Only users with topic management privileges can see it.


  • I made the following sequence after installation of GIT in my note with windows 10:

    $$ git config --global user.name "Fabrício Valle"
    $$ git config --global user.mail "meu email"

    *I informed my email correctly, with its own domain. I also used another email from gmail.

    In this step, he made the following mistake:

    ~$ git config —global user-mail
    «resources@fabriciovalle. com.br» error: key does not contain a section:
    user-mail



  • The correct command is git config --global user.email "recursos@fabriciovalle.com.br".
    you forgot ‘e’ in email and separated the words with a dash instead a point

    These three links should be useful to you:
    — https://gist.github.com/leocomelli/2545add34e4fec21ec16
    — http://rogerdudler.github.io/git-guide/index.pt_BR.html
    — https://git-scm.com/book/pt-br/v2


  • 1 / 1

Suggested Topics

  • 2

    0
    Votes

    2
    Posts

    0
    Views

    J

    If you have any questions about what you are trying to write below, then you are not sure if you are asking if you can not do it with ash.Is it better to set bash as a shell on package on Alpine Linux?In bash and zsh, I think that there are many ways to use the __git_ps1 function defined in git-prompt.sh. In ash, I think it is probably not working as it is.git-prompt.sh can be run on ash, but I didn’t see anyone doing such work even if I searched the net. Sorry, this entry is only available in Japanese. )I think that there are many parts that can not be put on bash or zsh for the ecosystem of the development environment using various tools including git recently.On the contrary, bash and zsh make it easy to get the benefits of the convenient ecosystem that others have made.

  • 2

    0
    Votes

    2
    Posts

    0
    Views

    morde

    You can prove if the next thing works for you:You should change the part in which you arm the header and as you call the mail function for the following:$header = «From: <«.$from.»>».PHP_EOL;
    $header .= ‘MIME-Version: 1.0’.PHP_EOL;
    $header .= «Content-Type: multipart/mixed; boundary=»».$uid.»»»;
    $message = «—» .$uid.PHP_EOL;
    $message .= ‘Content-type: text/html; charset=iso-8859-1’.PHP_EOL;
    $message .= «Content-Transfer-Encoding: 7bit».PHP_EOL.PHP_EOL;
    $message .= $mensaje.PHP_EOL;
    $message .= «—«.$uid.PHP_EOL;
    $message .= «Content-Type: «.$file_type.»; name=»».$file_name.»»».PHP_EOL;
    $message .= «Content-Transfer-Encoding: base64».PHP_EOL;
    $message .= «Content-Disposition: attachment; filename=»».$file_name.»»».PHP_EOL.PHP_EOL;
    $message .= $content.PHP_EOL;
    $message .= «—«.$uid.»—«;
    And you call the mail function like this:mail($to, $asunto, $message, $header)
    So you separate the header from the message content this way to see if it works for you.

  • 2

    0
    Votes

    2
    Posts

    0
    Views

    C

    simply git has not been installed or has been established very strangely (not described in the PATH variable). I’d start with the guita plant. https://git-scm.com/downloads

  • 2

    0
    Votes

    2
    Posts

    0
    Views

    C

    Friend,Among the Gitlab configuration files is one with the name «diff.rb», I believe it is in some directory within the «/opt/gitlab/embedded/service/gitlab-rails/» It will have two parameters of «Limit» of Diff, something like «DIFF_SIZE_LIMIT» and «DIFF_COLLAPSE_LIMIT» (or something like that), change their value to something like 102400.I hope I helped.

  • 2

    0
    Votes

    2
    Posts

    0
    Views

    J

    git It’s a version control system, and GitHub Desktop — it’s a graphic guita-oriented hythab client, and it works through the guita, respectively. So you can’t do the same without a guitar, because a client( GitHub Desktop) can’t work without the very own version control system. In fact, this client can be replaced by any other (e.gitk) and work the same way as before, or working directly from the console, or through a tool built-in.Also for information, Hithab is a repository server, so there’s no direct connection to the guitar, just the guys have made a start-up for the comfortable installation of the guitars, and so the repository hythoria can and sometimes need to be placed on their servers. There’s an alternative for guitahab, a batbac, and other repositors.I hope it’s clearer.

  • 2

    0
    Votes

    2
    Posts

    0
    Views

    P

    If the order of creation of the tables is the one you mention:CategoriesOutputsYou must carry out these changes:The columns to relate must be of the same type of data, then decide if they will be VARCHAR or INTEGERSecond must be of the same length You must add your foreign key as an indexCodeTable of categoriesCREATE TABLE `categorias` (
    `id` int(11) NOT NULL,
    `nombre` varchar(40) NOt null
    ) ;
    Table of productsCREATE TABLE productos(
    pertenece_categoria varchar(40) not null,
    nombre_producto varchar(50) not null,
    marca varchar(35) not null,
    medida varchar(10) not null,
    precio int not null,
    estado boolean default 0,
    index(pertenece_categoria),
    foreign key (pertenece_categoria) references
    categorias(nombre)
    )engine=InnoDB default charset=utf8;

  • 2

    0
    Votes

    2
    Posts

    0
    Views

    Alberto

    If you’ve ever sent files to Git repositories once, you can download them with a team. https://git-scm.com/book/ru/v2/%D0%9E%D1%81%D0%BD%D0%BE%D0%B2%D1%8B-Git-%D0%A1%D0%BE%D0%B7%D0%B4%D0%B0%D0%BD%D0%B8%D0%B5-Git-%D1%80%D0%B5%D0%BF%D0%BE%D0%B7%D0%B8%D1%82%D0%BE%D1%80%D0%B8%D1%8F#r_git_cloning git clone адрес-репозитория♪ And you don’t need to create an additional copy somewhere on Google Disk. Git is already this repository.But if you already have a copy on the CD and you want to update the latest data, then you need to get a trace. git pull origin, this will allow the downloading of all data and branches from a remote repository.If it’s necessary to the branch, then git pull origin <название ветки>♪git pull origin master or git pull origin mainFor new developments in Git repositories: git push origin <название ветки># В ветку master
    git push origin master
    В ветку main
    git push origin main
    В ветку develop
    git push origin develop
    Here. https://git-scm.com/book/ru/v2 free book in Russian

  • 2

    0
    Votes

    2
    Posts

    0
    Views

    D

    Before the repository begins, you must initiate it by command. git init♪ Rapidly learning to work with Git will help this interactive course: http://try.github.io/ ♪Either go to the catalogue (pupke, directory) containing formerly formed repositories by team cd♪cd /var/www/html/
    Such a folder (cataloga, directory) is the presence of a git folder (at the beginning, i.e., hidden) inside.
    Seeing the contents of the directory (cataloga, folder) with the help of the team. ls key (option) -a or -Als -a
    . .. .git index.nginx-debian.html
    ls -A
    .git index.nginx-debian.html
    Parameter -l (long listing format) makes it clear that .git — it’s the directory. d at the beginning of the properties instead of the sign — If I could, .git was a file)ls -lA
    total 8
    drwxr-xr-x 7 root root 4096 Apr 24 01:58 .git
    -rw-r—r— 1 root root 430 Apr 20 08:53 index.nginx-debian.html
    Depending on your command envelope (shell), the withdrawal of the ls command or the road vehicle (referred to as Tab) may provide the catalogues to be followed at the end when their list is removed..git/
    In order to use git in everyday work, it is convenient to modify the invitation to command (promt) the addition to instructions on the use of a system of control of versions chosen by the branch, the comet and the status of the directory,
    as described, for example, https://stackoverflow.com/questions/15883416/adding-git-branch-on-the-bash-command-prompt

  • 2

    0
    Votes

    2
    Posts

    0
    Views

    inna

    An English-speaking solution. Import regular project.Note that imported data are not Eclipse (no build path)Open up..project The file in the imported project file.Move to section source Find out. <natures></natures> and change. <natures><nature>org.eclipse.jdt.core.javanature</nature></natures> and keep the file.Eclipse right click on the folder srcCome in. Build Path… Click Use as Source Folder https://stackoverflow.com/a/32407205/5244594 For more theoretical convenience in the future, the project maven rather than the Eclipse project became operational. More universality and transferability. When importing the maven project, the existing Maven Project should be imported. Eclipse itself determines that the project belongs to git. Ultimately, we have a project with automatic control of relationships in git repository, which allows synchronization of the project not only between machines but also between the different IDEs that support maven.

  • 2

    0
    Votes

    2
    Posts

    0
    Views

    Analeea

    First of all, we need to download the repository correctly. Press Clone or download. Then on «Open in Desktop.» Put GitHube on your computer, and then, with his help, download the repositories, now you can edit it and lick it at the same place where you’ve been downloaded, press the tie on the Intalij IDEA control panel:
    After a tie, there’s a new window in which the Commit and Push team is to be selected.

  • 2

    0
    Votes

    2
    Posts

    0
    Views

    E

    You need to redesign. hashCode()♪Someone claims that hashCode() Total Object Uses random numbers, so both of your equivalent keys have different ones.Different hash is different objects. Do equals() It doesn’t even work.That’s the story, by the way. http://habrahabr.ru/post/168195/

  • 2

    0
    Votes

    2
    Posts

    0
    Views

    R

    In the end I don’t know what happened, I did your tips to run administrator, and I followed the installation steps and nothing for which I chose to format the notebook as if I didn’t progress I wouldn’t be able to continue my tasks. As a conclusion now that I’m thinking, I don’t know if it’s been a port error or that SQL Server took care of something that Oracle was occupying.

  • 2

    0
    Votes

    2
    Posts

    0
    Views

    G

    Use the Pulle Revest Model (Fork + Pull) instead of the General Repository model(The Shared Repository Model).Hithab recommends https://help.github.com/articles/using-pull-requests/

  • 2

    0
    Votes

    2
    Posts

    0
    Views

    C

    sublime_text.exe wrote himself as a comment editor.
    You should change the editor, like that.git config —global core.editor «notepad»
    Or anyone else. https://help.github.com/en/github/using-git/associating-text-editors-with-git

  • 2

    0
    Votes

    2
    Posts

    0
    Views

    A

    Change the source of your CMD, right click within the window, properties, source and there you put it Consolas For example.

  • Forum
  • Unread
  • Recent
  • Users
  • Groups
  • Menu
  • Job Openings
  • Freelance Jobs
  • Companies
  • Conferences
  • Courses

I recently transferred a git repository to a new organization. I ran the following:

git remote set-url origin https://github.com/organizationname/therepo.git

I am successfully pulling/pushing from the new location. But now getting the following errors every time I run a git command:

error: key does not contain a section: repositoryformatversion
error: key does not contain a section: filemode
error: key does not contain a section: bare
error: key does not contain a section: logallrefupdates
error: key does not contain a section: ignorecase
error: key does not contain a section: precomposeunicode

I initially thought it had to do with my config file however those fields are present. The first lines of My /.git/config file looks like this:

repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true

In this answer it suggests to check for --get-regex but I do not see any reference to that in my config or .gitconfig files. It looks like I have 2 git config files:

/usr/local/git/etc/gitconfig

and:

/Users/chmd/.gitconfig

I tried adding those keys to /Users/chmd/.gitconfig file with no such luck. What step am I missing to clear out these errors? Based on previous answer and research it seems to be my config, but I’m including those fields in my gitconfig?

Понравилась статья? Поделить с друзьями:
  • Error key could not be looked up remotely
  • Error kernel security check failure
  • Error kernel panic
  • Error kernel configuration is invalid
  • Error keepererrorcode connectionloss for hbase master