Skip to content

Instantly share code, notes, and snippets.

@cloud-walker
Last active February 17, 2023 13:49
Show Gist options
  • Select an option

  • Save cloud-walker/d1ea925dc24f0901a135c1ffeac5f028 to your computer and use it in GitHub Desktop.

Select an option

Save cloud-walker/d1ea925dc24f0901a135c1ffeac5f028 to your computer and use it in GitHub Desktop.

Revisions

  1. cloud-walker revised this gist Feb 17, 2023. 2 changed files with 54 additions and 14 deletions.
    14 changes: 0 additions & 14 deletions aliases.md
    Original file line number Diff line number Diff line change
    @@ -1,14 +0,0 @@
    ## Base configuration
    Global for me: add them on `~/.gitconfig`

    ```
    [alias]
    s = status -s
    unstage = reset HEAD --
    last = log -l HEAD
    lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
    branch-name = rev-parse --abbrev-ref HEAD
    publish = !git push -u origin $(git branch-name)
    unpublish = !git push origin :$(git branch-name)
    ```

    54 changes: 54 additions & 0 deletions config.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,54 @@
    ## Base configuration
    Global for me: add them on `~/.gitconfig`

    ```
    [[filter "lfs"]
    clean = git-lfs clean -- %f
    smudge = git-lfs smudge -- %f
    process = git-lfs filter-process
    required = true
    [init]
    defaultBranch = main
    [pull]
    ff = only
    [rerere]
    enabled = true
    [alias]
    s = status -s
    lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
    unstage = reset HEAD --
    ua = unstage
    pushf = push --force-with-lease
    pullr = pull --rebase
    amend = commit --amend --no-edit
    df = diff --ignore-space-at-eol -b -w --ignore-blank-lines
    last = log -l HEAD
    branch-name = rev-parse --abbrev-ref HEAD
    publish = !git push -u origin $(git branch-name)
    unpublish = !git push origin :$(git branch-name)
    a = add
    ap = add -p
    c = commit --verbose
    ca = commit -a --verbose
    cm = commit -m
    cam = commit -a -m
    m = commit --amend --verbose
    # list branches sorted by last modified
    b = "!git for-each-ref --sort='-authordate' --format='%(refname)' refs/heads | sed -e 's-refs/heads/--'"
    # list aliases
    la = "!git config -l | grep alias | cut -c 7-"
    new = checkout -b
    # branch delete: This checks out your local master branch and deletes all local branches
    # that have already been merged to master
    brd = !sh -c \"git checkout main && git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d\"
    # branch delete here: Deletes all local branches that have already been merged to the branch
    # that you're currently on
    brdhere = !sh -c \"git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d\"
    ```

  2. cloud-walker revised this gist Jul 24, 2022. 1 changed file with 0 additions and 8 deletions.
    8 changes: 0 additions & 8 deletions aliases.md
    Original file line number Diff line number Diff line change
    @@ -12,11 +12,3 @@ Global for me: add them on `~/.gitconfig`
    unpublish = !git push origin :$(git branch-name)
    ```

    ## Spawn Env management
    to be added on the `.git/config` file per project

    ```
    [alias]
    spawn-publish = "!f() { readonly BRANCH=$(git branch-name) && git checkout -b \"${BRANCH}_spawn_env\" && git publish && git checkout $BRANCH; }; f"
    spawn-update = "!f() { readonly BRANCH=$(git branch-name) && git checkout \"${BRANCH}_spawn_env\" && git rebase $BRANCH && git push -f && git checkout $BRANCH; }; f"
    ```
  3. cloud-walker renamed this gist Apr 19, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. cloud-walker revised this gist Apr 19, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    `rm -rf .git/rr-cache` to **completely** remove the `git rerere` cache
  5. cloud-walker revised this gist Apr 19, 2017. No changes.
  6. cloud-walker revised this gist Mar 24, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions aliases.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Base configuration
    ## Base configuration
    Global for me: add them on `~/.gitconfig`

    ```
    @@ -12,7 +12,7 @@ Global for me: add them on `~/.gitconfig`
    unpublish = !git push origin :$(git branch-name)
    ```

    # Spawn Env management (
    ## Spawn Env management
    to be added on the `.git/config` file per project

    ```
  7. cloud-walker revised this gist Mar 24, 2017. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions aliases.md
    Original file line number Diff line number Diff line change
    @@ -3,13 +3,13 @@ Global for me: add them on `~/.gitconfig`

    ```
    [alias]
    s = status -s
    unstage = reset HEAD --
    last = log -l HEAD
    lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
    branch-name = rev-parse --abbrev-ref HEAD
    publish = !git push -u origin $(git branch-name)
    unpublish = !git push origin :$(git branch-name)
    s = status -s
    unstage = reset HEAD --
    last = log -l HEAD
    lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
    branch-name = rev-parse --abbrev-ref HEAD
    publish = !git push -u origin $(git branch-name)
    unpublish = !git push origin :$(git branch-name)
    ```

    # Spawn Env management (
  8. cloud-walker created this gist Mar 24, 2017.
    22 changes: 22 additions & 0 deletions aliases.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    # Base configuration
    Global for me: add them on `~/.gitconfig`

    ```
    [alias]
    s = status -s
    unstage = reset HEAD --
    last = log -l HEAD
    lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
    branch-name = rev-parse --abbrev-ref HEAD
    publish = !git push -u origin $(git branch-name)
    unpublish = !git push origin :$(git branch-name)
    ```

    # Spawn Env management (
    to be added on the `.git/config` file per project

    ```
    [alias]
    spawn-publish = "!f() { readonly BRANCH=$(git branch-name) && git checkout -b \"${BRANCH}_spawn_env\" && git publish && git checkout $BRANCH; }; f"
    spawn-update = "!f() { readonly BRANCH=$(git branch-name) && git checkout \"${BRANCH}_spawn_env\" && git rebase $BRANCH && git push -f && git checkout $BRANCH; }; f"
    ```