Skip to content

Latest commit

 

History

History
107 lines (79 loc) · 2.61 KB

readme.md

File metadata and controls

107 lines (79 loc) · 2.61 KB

My Git setup

This is my git setup for get more productivity and speed in git workflow. Hope you canget something on this repository

Image Preview

  • git log pretty shortcut g lp
  • tig - git gui tig

Go to

Credits

OS support

  • Windows
  • Windows (WSL)
  • Linux
  • macOS

Package requirement

Contents

  1. Open .gitconfig file
  2. Add alias to .gitconfig file
  3. Usage

2. Tig

  1. Install Tig
  2. Usage

1. aliases (shortcuts) in Git

1.1 Open .gitconfig file

vim ~/.gitconfig

1.2 Add config to .gitconfig file

Copy this command and append to file that you open in 1.1

[core]
        editor = nvim
[alias]
        i = init
        a = add
        aa = add .
        rst = restore
        rsta = restore .

        st = status

        ci = commit
        cim = commit -m
        t = tag

        lp = log --pretty=format:\"%Cgreen%h %Creset%cd %Cblue[%cn] %Creset%s%C(yellow)%d%C(reset)\" --graph --date=relative --decorate --all
        llog = log --graph --name-status --pretty=format:\"%C(red)%h %C(reset)(%cd) %C(green)%an %Creset%s %C(yellow)%d%Creset\" --date=relative

        d = diff

        m = merge

        br = branch
        bra = branch -a
        co = checkout
        cob = checkout -b

        find = "!f() { git log --pretty=format:\"%h %cd [%cn] %s%d\" --date=relative -S'pretty' -S\"$@\" | peco | awk '{print $1}' | xargs -I {} git diff {}^ {}; }; f"

        rma = remote add origin

        pa = push --all
        pt = push --tags
[diff]
        tool = nvimdiff

1.3 Usage

You can add or see what alias that can use from this

[alias]
    <alias> = <full command>

2. Tig

2.1. Install Tig

brew install tig

Note

If you don't have Brew, you can get installation tutorial from this chinhchin/Fish-Shell-setup.

2.2. Usage

You can find usage solution by go to directory that have repository then type "Tig" and press "h"