{"id":22144745,"url":"https://github.com/mohamedsaidsallam/git-aliases","last_synced_at":"2026-05-05T19:33:39.548Z","repository":{"id":135770964,"uuid":"580158867","full_name":"MohamedSaidSallam/git-aliases","owner":"MohamedSaidSallam","description":"Personal list of git aliases I use. Along with a script to generate a script to add them to your config","archived":false,"fork":false,"pushed_at":"2023-03-05T06:53:00.000Z","size":49,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T12:51:25.571Z","etag":null,"topics":["bash","bash-script","git","git-alias","git-aliases","github-actions"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MohamedSaidSallam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-19T21:34:14.000Z","updated_at":"2022-12-21T06:46:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0ad9f6b-7929-4075-b049-82921b105689","html_url":"https://github.com/MohamedSaidSallam/git-aliases","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MohamedSaidSallam/git-aliases","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MohamedSaidSallam%2Fgit-aliases","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MohamedSaidSallam%2Fgit-aliases/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MohamedSaidSallam%2Fgit-aliases/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MohamedSaidSallam%2Fgit-aliases/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MohamedSaidSallam","download_url":"https://codeload.github.com/MohamedSaidSallam/git-aliases/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MohamedSaidSallam%2Fgit-aliases/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32665056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","bash-script","git","git-alias","git-aliases","github-actions"],"created_at":"2024-12-01T22:31:49.976Z","updated_at":"2026-05-05T19:33:39.531Z","avatar_url":"https://github.com/MohamedSaidSallam.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Aliases\n\nThis is my personal git aliases I use. Some I picked up, some created and some stolen from [durdn](https://github.com/durdn/cfg/blob/master/.gitconfig) (Check him out. He has a lot of cool aliases that don't fit my use cases but might fit yours).\n\nFeel free to read through them in [.gitconfig](.gitconfig) (I gave a description for some of them in [#What they do?](#what-they-do)). Or go straight to [adding them](#how-to-use) to your config file.\n\n## What they do?\n\nMost of them are simple shortcuts\n\n```ini\n    ci = commit\n    cl = clone\n    br = branch\n```\n\nSome with parameters or sub commands\n\n```ini\n    cian = commit --amend --no-edit\n\n    cob = checkout -tb\n\n    st = status -sb\n\n    sl = stash list\n\n    po = push -u origin HEAD\n```\n\n### Fancier aliases\n\n- [git um](#git-um)\n- [git lsa](#git-lsa)\n- [git qc](#git-qc)\n- [git lc](#git-lc)\n- [git lg](#git-lg)\n\n#### git um\n\n\u003e update master/main\n\ncheckout master or main (which ever is present) and pull\n\nExpanded:\n\n```bash\n!(git checkout master || git checkout main) \u0026\u0026 git pull -r\n```\n\n#### git lsa\n\n\u003e ls aliases\n\nExpanded:\n\n```bash\n!git config -l \\| grep ^alias \\| cut -c 7- \\| awk -F= '{first=$1;$1=\\\"\\\";printf(\\\"%-12s %s\\\\n\\\",first,$0);}'\"\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eOutput:\u003c/summary\u003e\n\n```bash\n$ git lsa\nci            commit\ncia           commit --amend\ncian          commit --amend --no-edit\ncim           commit -m\nco            checkout\ncob           checkout -tb\nst            status -sb\ncl            clone\nbr            branch\nr             reset\ncp            cherry-pick\ngr            grep -Ii\ns             stash\nsl            stash list\nsa            stash apply\nss            stash save\nlasttag       describe --tags --abbrev 0\nlt            describe --tags --abbrev 0\np             push\npo            push -u origin HEAD\num            !(git checkout master || git checkout main) \u0026\u0026 git pull -r\nlsa-raw       !git config -l | grep ^alias | cut -c 7-\nlsa           !git lsa-raw  | awk -F  '{first $1;$1 \"\";printf(\"%-12s %s\\n\",first,$0);}'\nlsal          !git lsa-raw  | awk -F  '{first $1;$1 \"\";printf(\"%12s %s\\n\",first,$0);}'\nqc            !f() { git stash \u0026\u0026 git um \u0026\u0026 git co -tb \"$1\" \u0026\u0026 git stash pop \u0026\u0026 git add . \u0026\u0026 git ci -m \"${1}: ${2}\" -m '' -m \"${3:-desc}\"; } ; f\nempty         !git commit -am\"[empty] Initial commit\" --allow-empty\nlightclone    !echo -e \"!--------------------!\nlc            lightclone\nlogg          log --graph --oneline --decorate\nlogga         logg --all\nlg            log --color --graph --pretty format:'%C(yellow)%h%Creset -%C(cyan)%d%Creset %s %Cgreen(%cr) %C(bold blue)\u003c%an\u003e%Creset' --abbrev-commit\nlga           lg --all\nglsa          !git lsa  | grep\n```\n\n\u003c/details\u003e\n\nAlternatives:\n\n- `git lsa-raw`: no formatting\n- `git lsal`:  left padding for the alias name\n\n    ```text\n          lg  log --color --graph --pretty format:'%C(yellow)%h%Creset -%C(cyan)%d%Creset %s %Cgreen(%cr) %C(bold blue)\u003c%an\u003e%Creset' --abbrev-commit\n         lga  '!git lol --all'\n    ```\n\n- `git glsa`: lsa with grep\n\n    ```bash\n    $ git glsa lsa\n    lsa-raw       !git config -l | grep ^alias | cut -c 7-\n    lsa           !git lsa-raw  | awk -F  '{first $1;$1 \"\";printf(\"%-12s %s\\n\",first,$0);}'\n    lsal          !git lsa-raw  | awk -F  '{first $1;$1 \"\";printf(\"%12s %s\\n\",first,$0);}'\n    glsa          !git lsa  | grep\n    ```\n\n#### git qc\n\n\u003e quick commit\n\nParameters:\n\n1. Feature Name/Ticket Name: used in branch name and commit message\n2. Commit message (optional)\n3. Commit Description (optional)\n\nExpanded:\n\n```bash\n\"!f() { git stash \u0026\u0026 git um \u0026\u0026 git co -tb \\\"$1\\\" \u0026\u0026 git stash pop \u0026\u0026 git add . \u0026\u0026 git ci -m \\\"${1}: ${2}\\\" -m '' -m \\\"${3:-desc}\\\"; } ; f\"\n```\n\nBuckle Up!\n\n1. stash\n2. checkout and update master ([git um](#git-um))\n3. create a new branch with the given ticket name\n4. pop stash\n5. add all\n6. commit using parameters\n\n#### git lc\n\n\u003e light clone\n\nalias: `git lightclone`\n\nOnly use this for checking out a repo you just found. Using `depth` when cloning a repo for development can lead to unexpected behavior.\n\nExpanded:\n\n```bash\necho XXXX \u0026\u0026 git clone --depth 10 --single-branch\n```\n\nExample:\n\nNormal:\n\n```bash\n$ git clone https://github.com/facebook/react.git\nCloning into 'react'...\nremote: Enumerating objects: 215295, done.\nReceiving objects:  17% (37309/215295), 40.29 MiB | 3.07 MiB/s\n\n# ctrl c\n```\n\nlight clone:\n\n```bash\n$ git lc https://github.com/facebook/react.git\n!--------------------!\nDepth is set to 10!\nCan lead to UNEXPECTED behaviour.\nUseful if you are only checking out repo, not using it for development\n!--------------------!\nCloning into 'react'...\nremote: Enumerating objects: 2827, done.\nremote: Counting objects: 100% (2827/2827), done.\nremote: Compressing objects: 100% (2334/2334), done.\nremote: Total 2827 (delta 699), reused 1043 (delta 383), pack-reused 0\nReceiving objects: 100% (2827/2827), 5.91 MiB | 656.00 KiB/s, done.\nResolving deltas: 100% (699/699), done.\n```\n\n#### git lg\n\n\u003e log\n\n`git log` with custom formatting (one liners, relative time from commit, author name).\n\nExpanded:\n\n```bash\nlog --color --graph --pretty=format:'%C(yellow)%h%Creset -%C(cyan)%d%Creset %s %Cgreen(%cr) %C(bold blue)\u003c%an\u003e%Creset' --abbrev-commit\n```\n\nOutput:\n\n![lg.png](docs/lg.png)\n\n## How to use?\n\nYou can either copy the content of [.gitconfig](.gitconfig) to your `~/.gitconfig`. Or execute [add_aliases.sh](add_aliases.sh) to add them to your `~/.gitconfig`.\n\nTo learn more about how the [add_aliases.sh](add_aliases.sh) was generated, Checkout [Github Action](#github-action) section.\n\n## Github Action\n\nuses [update_aliases.sh](update_aliases.sh) to update [add_aliases.sh](add_aliases.sh) on push.\n\nSteps:\n\n1. Checkout code.\n2. Generate a new [add_aliases.sh](add_aliases.sh) script from [.gitconfig](.gitconfig) using [update_aliases.sh](update_aliases.sh).\n3. Compare the newly generated [add_aliases.sh](add_aliases.sh) file with the one already present.\n4. If there's a difference\n    1. Replace old [add_aliases.sh](add_aliases.sh) with the updated one\n    2. Commit the update.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohamedsaidsallam%2Fgit-aliases","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohamedsaidsallam%2Fgit-aliases","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohamedsaidsallam%2Fgit-aliases/lists"}