Matúš Rebroš
Matúš Rebroš

Reputation: 161

Git - bad config on line 69 in .gitconfig

I started to learn git a I'm making folder to repository.

In folder which I need init is only one index.html and app.js nothing else.

I entered:

$ git init

and error was following

fatal: bad config line 69 in file /Users/matusrebros/.gitconfig

Here is lines from .gitconfig

    66 # Merge GitHub pull request on top of the current branch or,
    67 # if a branch name is specified, on top of the specified branch
    68 mpr = "!f() { \
    69
    70 # Detect whitespace errors when applying a patch
    71 whitespace = fix

On line 69 I have nothing.

So I need make folder as repository with command $ git init.

Upvotes: 1

Views: 309

Answers (1)

Rob Bajorek
Rob Bajorek

Reputation: 6560

Based on the snippet you posted, it looks like the .gitconfig file is from here:

https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig

That part of the file where you had the error was missing a chunk of text. It was supposed to look like this:

    # Merge GitHub pull request on top of the current branch or,
    # if a branch name is specified, on top of the specified branch
    mpr = "!f() { \
        declare currentBranch=\"$(git symbolic-ref --short HEAD)\"; \
        declare branch=\"${2:-$currentBranch}\"; \
        if [ $(printf \"%s\" \"$1\" | grep '^[0-9]\\+$' > /dev/null; printf $?) -eq 0 ]; then \
            git fetch origin refs/pull/$1/head:pr/$1 && \
            git checkout -B $branch && \
            git rebase $branch pr/$1 && \
            git checkout -B $branch && \
            git merge pr/$1 && \
            git branch -D pr/$1 && \
            git commit --amend -m \"$(git log -1 --pretty=%B)\n\nCloses #$1.\"; \
        fi \
    }; f"


[apply]

    # Detect whitespace errors when applying a patch
    whitespace = fix

If you like, you could replace your .gitconfig with the original at the link I posted above. Or since it looks like Lasse Vågsæther Karlsen helped you get it working, you can leave it alone.

Upvotes: 1

Related Questions