Skip to content

Instantly share code, notes, and snippets.

@ChaseFlorell
Last active April 30, 2021 22:18
Show Gist options
  • Select an option

  • Save ChaseFlorell/44eebb15832d1777d6da4d4e9c26c5b2 to your computer and use it in GitHub Desktop.

Select an option

Save ChaseFlorell/44eebb15832d1777d6da4d4e9c26c5b2 to your computer and use it in GitHub Desktop.

Revisions

  1. ChaseFlorell revised this gist Apr 30, 2021. 1 changed file with 39 additions and 17 deletions.
    56 changes: 39 additions & 17 deletions .gitconfig
    Original file line number Diff line number Diff line change
    @@ -1,27 +1,49 @@
    [user]
    name = MY NAME
    email = [email protected]
    initials = ME
    [branches]
    default = master
    [rebase]
    autoStash = true
    autoStash = true
    [alias]
    co = checkout
    st = status -s
    stats = shortlog -sn --no-merges
    lg = log --decorate --pretty=format:%h%x09%an%x09%ad%x09%s --no-merges
    cleanup = "!git fetch --all && git branch --merged | grep -v '\\*\\|master\\|develop\\|development\\|dev\\|vnext' | xargs -n 1 git branch -d"
    new = checkout -b
    alias = config --get-regexp ^alias\\. # List all aliases.
    ec = config --global -e # open .gitconfig in the default editor
    update = "!function f {\nDEFAULT_BRANCH=\"development\"\nif [ -z \"$1\" ]; then\nread -rsn1 -p \"Use the default ${DEFAULT_BRANCH} branch? [Enter]\";echo\nif [[ $REPLY == '' ]];then\necho \"Rebasing origin/${DEFAULT_BRANCH}\"\ngit pull --rebase origin ${DEFAULT_BRANCH}\nexit 0\nelse\necho \"No branch specified, aborting.\"\nexit 1\nfi\nfi\necho \"Rebasing origin/${1}\"\ngit pull --rebase origin ${1}\n}; f"
    up = update

    co = checkout
    st = status -s
    stats = shortlog -sn --no-merges
    lg = log --decorate --pretty=format:%h%x09%an%x09%ad%x09%s --no-merges
    cleanup = "!git fetch --all && git branch --merged | grep -v \"\\*\\|master\\|main\\|develop\\|development\\|dev\\|release\\|vnext\\|$(git config branches.default)\" | xargs -n 1 git branch -d"
    cleanup-unsafe = "!git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done"
    cleanup-all ="!git cleanup && git cleanup-unsafe"
    new = checkout -b
    alias = config --get-regexp ^alias\\. # List all aliases.
    ec = config --global -e # open .gitconfig in the default editor
    update = "!function f {\nif [ -z \"$1\" ]; then\nread -rsn1 -p \"Use the default $(git config branches.default) branch? [Enter]\";echo\nif [[ $REPLY == '' ]];then\necho \"Rebasing origin/$(git config branches.default)\"\ngit pull --rebase origin $(git config branches.default)\nexit 0\nelse\necho \"No branch specified, aborting.\"\nexit 1\nfi\nfi\necho \"Rebasing origin/${1}\"\ngit pull --rebase origin ${1}\n}; f"
    up = update
    p = !git push --set-upstream origin `git symbolic-ref --short HEAD` #push whilst setting upstream to the same branch
    firedrill = "!git add . && git commit -m 'FIRE' && git p" #commit and push your work in a hurry
    new-bug = "!function f {\nINITIALS=\"$(git config user.initials)\"\ngit checkout -b users/${INITIALS}/bugfix/${1}\n}; f"
    new-task = "!function f {\nINITIALS=\"$(git config user.initials)\"\ngit checkout -b users/${INITIALS}/task/${1}\n}; f"
    nt = new-task
    nb = new-bug
    [commit]
    verbose = true
    verbose = true
    gpgsign = true
    [core]
    excludesfile = ~/.gitignore_global
    editor = code --wait
    excludesfile = ~/.gitignore_global
    editor = code --wait
    [diff]
    tool = diff-merge
    tool = diff-merge
    [merge]
    tool = diff-merge
    [difftool "diff-merge"]
    cmd = code --wait --diff \"$LOCAL\" \"$REMOTE\"
    [gc]
    auto = 0
    auto = 0
    [help]
    autocorrect = 20
    [pull]
    rebase = true
    [fetch]
    prune = true
    [rerere]
    enabled = true
  2. ChaseFlorell revised this gist Apr 15, 2019. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions .gitconfig
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    [rebase]
    autoStash = true
    autoStash = true
    [alias]
    co = checkout
    st = status -s
    @@ -13,15 +13,15 @@
    up = update

    [commit]
    verbose = true
    verbose = true
    [core]
    excludesfile = ~/.gitignore_global
    editor = code --wait
    excludesfile = ~/.gitignore_global
    editor = code --wait
    [diff]
    tool = diff-merge
    tool = diff-merge
    [merge]
    tool = diff-merge
    [difftool "diff-merge"]
    cmd = code --wait --diff \"$LOCAL\" \"$REMOTE\"
    [gc]
    auto = 0
    auto = 0
  3. ChaseFlorell revised this gist Apr 15, 2019. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions .gitconfig
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,16 @@
    [rebase]
    autoStash = true
    [alias]
    co = checkout
    st = status -s
    co = checkout
    st = status -s
    stats = shortlog -sn --no-merges
    lg = log --decorate --pretty=format:%h%x09%an%x09%ad%x09%s --no-merges
    cleanup = "!git fetch --all && git branch --merged | grep -v '\\*\\|master\\|develop\\|development\\|dev\\|vnext' | xargs -n 1 git branch -d"
    new = checkout -b
    alias = config --get-regexp ^alias\\. # List all aliases.
    ec = config --global -e # open .gitconfig in the default editor
    update = "!function f {\nDEFAULT_BRANCH=\"development\"\nif [ -z \"$1\" ]; then\nread -rsn1 -p \"Use the default ${DEFAULT_BRANCH} branch? [Enter]\";echo\nif [[ $REPLY == '' ]];then\necho \"Rebasing origin/${DEFAULT_BRANCH}\"\ngit pull --rebase origin ${DEFAULT_BRANCH}\nexit 0\nelse\necho \"No branch specified, aborting.\"\nexit 1\nfi\nfi\necho \"Rebasing origin/${1}\"\ngit pull --rebase origin ${1}\n}; f"
    up = update

    [commit]
    verbose = true
  4. ChaseFlorell revised this gist Apr 8, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .gitconfig
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@
    new = checkout -b
    alias = config --get-regexp ^alias\\. # List all aliases.
    ec = config --global -e # open .gitconfig in the default editor
    update = "!function f {\nDEFAULT_BRANCH=\"development\"\nif [ -z \"$1\" ]; then\nread -rsn1 -p \"Use the default ${DEFAULT_BRANCH} branch? [Enter]\";echo\nif [[ $REPLY == '' ]];then\necho \"Rebasing origin/${DEFAULT_BRANCH}\"\ngit pull --rebase origin ${DEFAULT_BRANCH}\nexit 0\nelse\necho \"No branch specified, aborting.\"\nexit 1\nfi\nfi\necho \"Rebasing origin/${1}\"\ngit pull --rebase origin ${1}\n}; f"
    update = "!function f {\nDEFAULT_BRANCH=\"development\"\nif [ -z \"$1\" ]; then\nread -rsn1 -p \"Use the default ${DEFAULT_BRANCH} branch? [Enter]\";echo\nif [[ $REPLY == '' ]];then\necho \"Rebasing origin/${DEFAULT_BRANCH}\"\ngit pull --rebase origin ${DEFAULT_BRANCH}\nexit 0\nelse\necho \"No branch specified, aborting.\"\nexit 1\nfi\nfi\necho \"Rebasing origin/${1}\"\ngit pull --rebase origin ${1}\n}; f"

    [commit]
    verbose = true
  5. ChaseFlorell created this gist Apr 8, 2019.
    26 changes: 26 additions & 0 deletions .gitconfig
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    [rebase]
    autoStash = true
    [alias]
    co = checkout
    st = status -s
    stats = shortlog -sn --no-merges
    lg = log --decorate --pretty=format:%h%x09%an%x09%ad%x09%s --no-merges
    cleanup = "!git fetch --all && git branch --merged | grep -v '\\*\\|master\\|develop\\|development\\|dev\\|vnext' | xargs -n 1 git branch -d"
    new = checkout -b
    alias = config --get-regexp ^alias\\. # List all aliases.
    ec = config --global -e # open .gitconfig in the default editor
    update = "!function f {\nDEFAULT_BRANCH=\"development\"\nif [ -z \"$1\" ]; then\nread -rsn1 -p \"Use the default ${DEFAULT_BRANCH} branch? [Enter]\";echo\nif [[ $REPLY == '' ]];then\necho \"Rebasing origin/${DEFAULT_BRANCH}\"\ngit pull --rebase origin ${DEFAULT_BRANCH}\nexit 0\nelse\necho \"No branch specified, aborting.\"\nexit 1\nfi\nfi\necho \"Rebasing origin/${1}\"\ngit pull --rebase origin ${1}\n}; f"

    [commit]
    verbose = true
    [core]
    excludesfile = ~/.gitignore_global
    editor = code --wait
    [diff]
    tool = diff-merge
    [merge]
    tool = diff-merge
    [difftool "diff-merge"]
    cmd = code --wait --diff \"$LOCAL\" \"$REMOTE\"
    [gc]
    auto = 0