DEV Community

Janardhan Pulivarthi
Janardhan Pulivarthi

Posted on

short tutorial on git config

Here is the starter config file.

you can open this with git config -e for any specific repository

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
        logallrefupdates = true
        symlinks = false
        ignorecase = true
[remote "origin"]
        url = https://github.com/j143/tcp
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
        remote = origin
        merge = refs/heads/main
[user]
        name = John Person
        email = jp@example.com
[credential "https://github"]
        com = j143
[credential]
        helper = store
[branch "show-tcp-syn-ack"]
    remote = origin
    merge = refs/heads/show-tcp-syn-ack
Enter fullscreen mode Exit fullscreen mode

credential

these lines control which credential to use

[credential "https://github"]
        com = j143
[credential]
        helper = store
Enter fullscreen mode Exit fullscreen mode

author

author details

[user]
        name = John Person
        email = jp@example.com
Enter fullscreen mode Exit fullscreen mode

Remote repository for example GitHub

How to reference a git server

[remote "origin"]
        url = https://github.com/j143/tcp
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
        remote = origin
        merge = refs/heads/main
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
j143 profile image
Janardhan Pulivarthi •

if you are not comfortable with vi editor, you can use vscode editor to edit config.

git config --global core.editor "code --wait"