{"id":23193952,"url":"https://github.com/evitanrelta/gitconfig","last_synced_at":"2026-05-15T18:03:14.868Z","repository":{"id":44353973,"uuid":"489671745","full_name":"EvitanRelta/gitconfig","owner":"EvitanRelta","description":"My extensive list of Git aliases","archived":false,"fork":false,"pushed_at":"2025-02-19T14:48:46.000Z","size":179,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-19T15:44:31.010Z","etag":null,"topics":["git","git-aliases","git-config"],"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/EvitanRelta.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-05-07T12:48:42.000Z","updated_at":"2025-02-19T14:48:50.000Z","dependencies_parsed_at":"2023-12-18T11:28:01.445Z","dependency_job_id":"51acd7a2-6a43-4e37-9ec0-261b37780936","html_url":"https://github.com/EvitanRelta/gitconfig","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvitanRelta%2Fgitconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvitanRelta%2Fgitconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvitanRelta%2Fgitconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvitanRelta%2Fgitconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EvitanRelta","download_url":"https://codeload.github.com/EvitanRelta/gitconfig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305906,"owners_count":20917202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["git","git-aliases","git-config"],"created_at":"2024-12-18T13:12:54.281Z","updated_at":"2026-05-15T18:03:14.861Z","avatar_url":"https://github.com/EvitanRelta.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Setup\n\nThe steps below is for creating symlinks in the system root, targeting the config files in this repo.\n\nSpecifically, it'll create these symlinks:\n\n```bash\n# In root: ~/\n.bash_profile@   --\u003e gitconfig/.bash_profile\n.bashrc@         --\u003e gitconfig/.bashrc\n.git_aliases@    --\u003e gitconfig/.git_aliases\n.gitconfig@      --\u003e gitconfig/.gitconfig\n.vim@            --\u003e gitconfig/.vim\n.vimrc@          --\u003e gitconfig/.vimrc\n```\n\n\u003cbr\u003e\n\n### On Linux\n\n```bash\ngit clone https://github.com/EvitanRelta/gitconfig\ncd gitconfig\nbash init.sh\n```\n\n\u003cbr\u003e\n\n### On Windows\n\n1. Run Git Bash as administrator\n2. Execute `export MSYS=winsymlinks:nativestrict` \\\n  _(this will allow creation of symlinks used in `init.sh`)_\n3. Do the steps in the `On Linux` section above\n\n\u003e _Based on: https://stackoverflow.com/a/40914277_\n\n\u003cbr\u003e\n\n## Git Aliases\n\n### `git ab`\n\nAborts the current rebase/merge/cherry-pick/revert command.\n\n```bash\n# Alias for:\nin_prog_cmd=\"$(git get-in-prog-cmd)\"\n    \u0026\u0026 echo \"Aborting $in_prog_cmd...\"\n    \u0026\u0026 eval \"git $in_prog_cmd --abort\"\n```\n\n\u003cbr\u003e\n\n### `git addf [filenames]`\n\nFuzzy add filenames.\n\nPrefix and suffix each filename with `*` to match every file that contains the\nkeyword.\n\n```bash\n# Alias for:\nfuzzy_filenames=$(echo \"$@\" | sed -E \"s/([^ ]+)/\\*\\\\1\\*/g\")\ngit add \"$fuzzy_filenames\"\n```\n\n\u003cbr\u003e\n\n### `git addn [file_paths]`\n\nNegative add. Adds everything except the specified file(s).\n\n```bash\n# Alias for:\ngit add -A\ngit reset [file_paths]\n\n# Usage:\ngit addn ./file1 ./dir/file2\n```\n\n\u003cbr\u003e\n\n### `git branch-d-both [branch_name]`\n\nDeletes branch both locally and on remote.\n\n```bash\n# Alias for:\ngit branch -d [branch_name]\ngit push -d origin [branch_name]\n```\n\n\u003cbr\u003e\n\n### `git cane`\n\n```bash\n# Alias for:\ngit commit --amend --no-edit\n```\n\n\u003cbr\u003e\n\n### `git clone-nonempty [-f] [github_repo_url] [clone_to_path]`\n\nClones repo into a non-empty dir.\n\u003cbr\u003e _(Force flag force overwrites any local files that conflicts with the repo files)_\n\n```bash\n# Alias for (w/o force flag):\nmkdir -p [clone_to_path]\ncd [clone_to_path]\ngit init\ngit remote add origin [github_repo_url]\ngit fetch\ngit checkout -t origin/master\n\n# Alias for (force flag):\n# Force overwrite any conflicting files\n...\ngit checkout -tf origin/master\n\n# Example usage:\ngit clone-nonempty -f https://github.com/EvitanRelta/my-repo .\n```\n\n\u003cbr\u003e\n\n### `git code-unmerged`\n\nOpen all unmerged files in VSCode editor via the `code` command.\n\nFor example, if `FILE1`, `PATH/TO/FILE2` and `../FILE3` are unmerged,\nthis command runs:\n\n```bash\ncode \"FILE1\"\ncode \"PATH/TO/FILE2\"\ncode \"../FILE3\"\n```\n\n\u003cbr\u003e\n\n### `git con`\n\nContinues the current rebase/merge/cherry-pick/revert command.\n\n```bash\n# Alias for:\nin_prog_cmd=\"$(git get-in-prog-cmd)\"\n    \u0026\u0026 echo \"Continuing $in_prog_cmd...\"\n    \u0026\u0026 eval \"git $in_prog_cmd --continue\"\n```\n\n\u003cbr\u003e\n\n### `git cone`\n\nContinues the current rebase/merge/cherry-pick/revert command while preventing the prompt for editing the commit message.\n\u003cbr\u003e_(similar to `--no-edit` flag for `git commit`)_\n\n```bash\n# Alias for:\nin_prog_cmd=\"$(git get-in-prog-cmd)\"\n    \u0026\u0026 echo \"Continuing $in_prog_cmd (no edit)...\"\n    \u0026\u0026 eval \"git -c core.editor=true $in_prog_cmd --continue\"\n```\n\n\u003cbr\u003e\n\n### `git conea`\n\nAdds all unstaged changes, then continues the current rebase/merge/cherry-pick/revert command while preventing the prompt for editing the commit message.\n\n```bash\n# Alias for:\ngit add -A\ngit cone\n```\n\n\u003cbr\u003e\n\n### `git copy-commit-metadata [--all|--committer|--author|--committer-date|--author-date|--message] [COMMIT_HASH]`\n\nAmends the last commit to copy the committer/author names and dates and commit\nmessage of `[COMMIT_HASH]`.\n\nTakes the flags which selects which metadata to copy:\n\n-   `--all`: All metadata\n-   `--committer`: Committer name/email\n-   `--author`: Author name/email\n-   `--committer-date`: Committer date\n-   `--author-date`: Author date\n-   `--message`: Commit message\n\n```bash\n# Alias for:\ncommitter_name=$(git show -s --format='%cn' [COMMIT_HASH])\ncommitter_email=$(git show -s --format='%ce' [COMMIT_HASH])\ncommitter_date=$(git show -s --format='%cd' [COMMIT_HASH])\nauthor=$(git show -s --format='%an \u003c%ae\u003e' [COMMIT_HASH])\nauthor_date=$(git show -s --format='%ad' [COMMIT_HASH])\ncommit_message=$(git show -s --format='%B' [COMMIT_HASH])\n\nGIT_COMMITTER_NAME=\"$committer_name\" \\\nGIT_COMMITTER_EMAIL=\"$committer_email\" \\\nGIT_COMMITTER_DATE=\"$committer_date\" \\\ngit commit --amend --no-edit \\\n    --author=\"$author\" \\\n    --date=\"$author_date\" \\\n    -m \"$commit_message\"\n```\n\n\u003cbr\u003e\n\n### `git cum [flags/parameters]`\n\n```bash\n# Alias for:\ngit add -A\ngit commit [flags/parameters]\n```\n\n\u003cbr\u003e\n\n### `git cumane`\n\n```bash\n# Alias for:\ngit add -A\ngit commit --amend --no-edit\n```\n\n\u003cbr\u003e\n\n### `git delete-this`\n\nDeletes the current branch, checking out to previous branch.\n\n```bash\n# Alias for:\ncurrent_branch=$(git get-current-branch)\ngit checkout -\ngit branch -D $current_branch\n```\n\n\u003cbr\u003e\n\n### `git diffst [flags/parameters]`\n\nPrints the diff of staged files.\n\n```bash\n# Alias for:\ngit diff --staged [flags/parameters]\n```\n\n\u003cbr\u003e\n\n### `git dump [-f]`\n\nDumps any unstaged changes.\n\u003cbr\u003e _(Force flag dumps staged changes too)_\n\n\u003e `:/` is to select all files, including files not in the current directory _(eg. \"../../file.ext\")_\n\n```bash\n# Alias for (w/o force flag):\ngit restore :/\ngit clean -df :/\n\n\n# Alias for (force flag):\ngit reset\ngit restore :/\ngit clean -df :/\n```\n\n\u003cbr\u003e\n\n### `git f [commit_hash]`\n\nCommit-fixup targeting `[commit_hash]`.\n\n```bash\n# Alias for:\ngit commit --fixup=[commit_hash]\n```\n\n\u003cbr\u003e\n\n### `git ff [remote]`\n\nFast-forwards current branch.\n\n- **No argument**: merges the upstream tracking branch (`@{u}`) with `--ff-only`. No fetch is performed.\n- **With `[remote]`**: fetches from the remote and fast-forwards to `remote/branch`.\n\n```bash\n# Alias for:\n\n# No argument:\ngit merge --ff-only @{u}\n\n# With [remote]:\ncurrent_branch=$(git get-current-branch)\ngit fetch [remote]\ngit merge --ff-only [remote]/$current_branch\n```\n\n\u003cbr\u003e\n\n### `git git [commands/flags/parameters]`\n\nFor when you accidentally type `git` twice.\n\n```bash\n# Alias for:\ngit [commands/flags/parameters]\n```\n\n\u003cbr\u003e\n\n### `git graph`\n\nDisplays Git commit graph.\n\n```bash\n# Alias for:\ngit log \\\n  --graph \\\n  --abbrev-commit \\\n  --decorate \\\n  --all \\\n  --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'\n```\n\n\u003cbr\u003e\n\n### `git link [-f] [github_repo_url]`\n\nLinks local repo to `[github_repo_url]`, by setting remote `origin` to url and set-upstream push.\n\u003cbr\u003e _(Force flag force-pushes local repo to remote)_\n\n```bash\n# Alias for (w/o force flag):\ngit remote add origin [github_repo_url]\ngit remote set-url origin [github_repo_url]\ngit push -u origin master\n\n\n# Alias for (force flag):\n...\ngit push -uf origin master\n```\n\n\u003cbr\u003e\n\n### `git merge-this`\n\nMerge _(no fast-forward)_ current branch _(ie. `[branch_name]`)_ to master, and deletes it locally.\n\n```bash\n# Alias for:\ngit checkout master\ngit merge --no-ff --no-edit [branch_name]\ngit branch -D [branch_name]\n```\n\n\u003cbr\u003e\n\n### `git pop [flags/parameters]`\n\n```bash\n# Alias for:\ngit stash pop [flags/parameters]\n```\n\n\u003cbr\u003e\n\n### `git pull-all [-s [ignore_branch_name] [ignore_branch_name] ...]`\n\nPulls all remote branches.\n\u003cbr\u003e `-s` skip-flag skips pulling `[ignore_branch_name]` remote branches.\n\n```bash\n# Alias for:\ngit fetch -p    # Update + prune remote branches\necho \"From $(git remote get-url origin)\"\nfor remote_branch in `git branch -r | grep -v \" -\u003e \" | grep \"origin/\"`; do\n    branch=${remote_branch#origin/}\n\n    git fetch\n        --update-head-ok            # Allows changes to current branch/HEAD\n        origin \"$branch:$branch\"    # Updates branch\n        2\u003e\u00261                        # Fix 'fetch' not outputting to 'grep'\n        | grep -v \"From\"            # Removes repeated \"From [REMOTE_URL]\"\n\n    git branch --quiet -u \"$remote_branch\" \"$branch\"    # Sets upstream, as 'git fetch' doesn't\ndone\n\n# '-s' skip-flag implementation too complicated to show\n```\n\n\u003cbr\u003e\n\n### `git pull-force`\n\nPulls and overwrite current local branch.\n\n```bash\n# Alias for:\ngit fetch\ngit reset --hard \"origin/$(git branch --show-current)\"\n```\n\n\u003cbr\u003e\n\n### `git pull-pr [username]:[branch] [optional_remote_name]`\n\nPulls (and checkout to) a PR's branch. The `[username]:[branch]` is given in\nthe GitHub's PR description.\n\nIf no remote with a URL containing `[username]` exists, create a new remote\nnamed `[username]` (or `[optional_remote_name]` if given) with a URL based on\n`origin` remote. \\\n_(eg. If `origin  https://github.com/EvitanRelta/repo` then the URL will be `https://github.com/[username]/repo`)_\n\nIf a remote exists, but it's name isn't equal to `[optional_remote_name]`, then\nthat remote is renamed to `[optional_remote_name]`.\n\nFor example, for the PR description: \\\n\"afiqzu wants to merge 1 commit into `CS3219-AY2324S1:assignment-5` from `afiqzu:assignment-5`\" \\\n`[username]:[branch]` = `afiqzu:assignment-5`\n\n```bash\n# Given this scenario:\n$ git remote -v\noldremote  https://github.com/EvitanRelta/repo\norigin     https://github.com/myorigin/repo\n```\n\n#### Example usage 1:\n```bash\ngit pull-pr EvitanRelta:pr-branch\n# is alias for:\ngit fetch oldremote\ngit checkout -b oldremote-pr-branch oldremote/pr-branch\n```\n\n#### Example usage 2:\n```bash\ngit pull-pr EvitanRelta:pr-branch newremote\n# is alias for:\ngit remote rename oldremote newremote\ngit fetch newremote\ngit checkout -b newremote-pr-branch newremote/pr-branch\n```\n\n#### Example usage 3:\n```bash\ngit pull-pr NewUser:pr-branch newremote\n# is alias for:\ngit remote add newremote https://github.com/NewUser/repo\ngit fetch newremote\ngit checkout -b newremote-pr-branch newremote/pr-branch\n```\n\n\u003cbr\u003e\n\n### `git push-until [commit]`\n\nPush all commits until (and including) `[commit]` to the `origin` branch of\nthe same name.\n\n```bash\n# Alias for:\ncurrent_branch=\"$(git get-current-branch)\"\ngit push origin \"[commit]:$current_branch\"\n```\n\n\u003cbr\u003e\n\n### `git pushu`\n\nPush (and setup to track) to the same branch-name on origin.\n\n```bash\n# Alias for:\ncurrent_branch=$(git get-current-branch)\ngit push -u origin $current_branch\n```\n\n\u003cbr\u003e\n\n### `git re [flags/parameters]`\n\nAlias for rebase.\n\u003cbr\u003eBut if no `-i` or `--interactive` is given, it will pass the `interactive` flag along with a noop editor.\n\u003cbr\u003e_(this is to force autosquash, which for some reason doesn't run without interactive)_\n\n```bash\n# Alias for (if interactive flag given):\ngit rebase [flags/parameters]\n\n# Alias for (if no interactive flag given):\nGIT_SEQUENCE_EDITOR=: git rebase -i [flags/parameters]\n```\n\n\u003cbr\u003e\n\n### `git rebase-from [inclusive_from_commit] [new_base]`\n\nRebase the current branch onto `[new_base]` starting from (and including) `[inclusive_from_commit]`.\n\u003cbr\u003e_(similar to `git rebase [new_base]` but only picking commits from `HEAD` up to `[inclusive_from_commit]`)_\n\u003cbr\u003e_(uses the `re` alias instead of `rebase`, to force autosquash)_\n\n```bash\n# Alias for:\ncurrent_branch=$(git get-current-branch)\ngit re --onto [new_base] [inclusive_from_commit]~ $current_branch\n```\n\n\u003cbr\u003e\n\n### `git rebase-preserve [same-options-as-rebase]`\n\nExactly the same as `rebase`, but preserves the author \u0026 committer names and dates of commits.\n\n```bash\n# Alias for (linebreaks for display purpose only):\ngit -c rebase.instructionFormat='%s%nexec\n    git copy-commit-metadata\n        --committer\n        --author\n        --committer-date\n        --author-date\n    %H' rebase [same-options-as-rebase]\n\n# Example usage:\ngit rebase-preserve -i --rebase-merges @~5\n```\n\n\u003cbr\u003e\n\n### `git rebun [interactve_command] [commit_hash]`\n\nRebases a single commit _(with `--rebase-merges` flag)_ without opening interactive editor.\n\u003cbr\u003e `[interactive_command]` is the `pick/edit/reword/fix` etc. command in the interactive editor.\n\n```bash\n# Alias for:\ngit rebase -i --rebase-merges [commit_hash]~\n# Then replacing the 'pick' of the oldest commit to [interactive_command]\n\n# Example ussage:\ngit rebun edit HEAD~3\ngit rebun e 2ea1622\ngit rebun reword HEAD~4\n```\n\n\u003cbr\u003e\n\n### `git redoc`\n\nCommit using the last undone (via `undoc` alias) commit's message.\n\n```bash\n# Alias for:\ngit commit -c [last_undone_commit] --no-edit\n```\n\n\u003cbr\u003e\n\n### `git replace-that [branch]`\n\nReplaces `[branch]` (ie. \"that\" branch) with current branch, then force deletes\ncurrent branch while checking out to `[branch]`.\n\n```bash\n# Alias for:\ncurrent_branch=$(git get-current-branch)\ngit checkout [branch]\ngit reset --hard \"$current_branch\"\ngit branch -D \"$current_branch\"\n```\n\n\u003cbr\u003e\n\n### `git replace-this [branch]`\n\nReplaces current branch (ie. \"this\" branch) with `[branch]`, then force deletes `[branch]`.\n\n```bash\n# Alias for:\ngit reset --hard [branch]\ngit branch -D [branch]\n```\n\n\u003cbr\u003e\n\n### `git show-stopped-unmerged`\n\nShows the changes of the commit that the current rebase has stopped at,\nspecifically only for the currently unmerged files.\n\n```bash\n# Alias for:\nunmerged_paths=\"$(git get-unmerged-paths)\"\ngit show-stopped -- \"$unmerged_paths\"\n```\n\n\u003cbr\u003e\n\n### `git show-stopped [flags/parameters]`\n\nShows the changes of the commit that the current rebase has stopped at.\n\n```bash\n# Alias for:\nstopped_commit_hash=\"$(git get-stopped-hash)\"\ngit show \"$stopped_commit_hash\" [flags/parameters]\n```\n\n\u003cbr\u003e\n\n### `git spoof-author [name] [email]`\n\nChanges the author/commiter names and emails of the previous commit.\n\n```bash\n# Alias for:\nGIT_COMMITTER_NAME=\"[name]\" GIT_COMMITTER_EMAIL=\"[email]\" git commit --amend --no-edit --author=\"[name] \u003c[email]\u003e\"\n```\n\n\u003cbr\u003e\n\n### `git spoof-dates [author-date] [committer-date]`\n\nChanges the author/commiter dates of the previous commit.\n\n```bash\n# Alias for:\nGIT_COMMITTER_DATE=\"[committer-date]\" git commit --date=\"[author-date]\" --amend --no-edit\n\n# Usage:\ngit spoof-dates \"Fri Dec 2 18:53:50 2022 +0800\" \"Fri Dec 2 18:54:09 2022 +0800\"\n```\n\n\u003cbr\u003e\n\n### `git st [flags/parameters]`\n\n```bash\n# Alias for:\ngit status [flags/parameters]\n```\n\n\u003cbr\u003e\n\n### `git stash-staged [flags/parameters]`\n\nStashes staged changes, leaving behind unstaged changes.\n\n```bash\n# Alias for:\ngit stash-unstaged --quiet\ngit stash -u [flags/parameters]\ngit stash pop --quiet \"stash@{1}\"\n```\n\n\u003cbr\u003e\n\n### `git stash-unstaged [flags/parameters]`\n\nStashes unstaged (and untracked) changes, leaving behind staged changes.\n\n```bash\n# Alias for:\ngit commit --quiet -m \"TEMP (staged changes)\"\ngit stash -u [flags/parameters]\ngit undoc\n```\n\n\u003cbr\u003e\n\n### `git undoc [-f]`\n\nUndo/Uncommit the last commit, keeping the commit's changes as staged.\n\u003cbr\u003e _(Force flag doesn't keep the commit's changes)_\n\nAlso saves the last undone commit's hash to `undoc_hash.temp` to be used by the\n`redoc` alias.\n\n```bash\n# Alias for (w/o force flag):\ngit reset --soft HEAD~\n\n# Alias for (force flag):\ngit reset --hard HEAD~\n```\n\n\u003cbr\u003e\n\n### `git unmerge`\n\nMust be on a merge commit.\n\u003cbr\u003eRestore the deleted branch from the merge commit, and undo the merge commit.\n\u003cbr\u003e_(effectively undoing `git merge-this`)_\n\n```bash\n# Alias for:\ngit restore-deleted-branch HEAD\ngit undoc -f\ngit checkout -\n```\n\n\u003cbr\u003e\n\n## Helper functions\n\n### `git branch-exists [branch]`\n\nChecks if branch `[branch]` exists.\n\u003cbr\u003e_(Used in conditional statements for other aliases)_\n\n```bash\n# Alias for:\ngit show-ref --quiet \"refs/heads/[branch]\"\n\n# Usage:\nif git branch-exists my-branch; then\n...\n```\n\n\u003cbr\u003e\n\n### `git get-current-branch`\n\nGets current branch name.\n\u003cbr\u003e_(Used in other aliases)_\n\n```bash\n# Alias for:\ngit rev-parse --abbrev-ref HEAD\n```\n\n\u003cbr\u003e\n\n### `git get-current-hash`\n\nGets current commit hash.\n\u003cbr\u003e_(Used in other aliases)_\n\n```bash\n# Alias for:\ngit rev-parse HEAD\n```\n\n\u003cbr\u003e\n\n### `git get-in-prog-cmd`\n\nIf is currently rebasing, merging, cherry-picking or reverting, outputs `rebase`, `merge`, `cherry-pick` or `revert` respectively.\nIf not, exit with error, and output \"Not currently rebasing, merging or cherry-picking\" to `stderr`.\n\u003cbr\u003e_(Used to infer the continue/abort/etc. commands for rebasing/merging/cherry-picking/etc)_\n\n```bash\n# Alias for:\nif git is-rebasing; then\n    echo rebase\nelif git is-merging; then\n    echo merge\nelif git is-cherry-picking; then\n    echo cherry-pick\nelif git is-reverting; then\n    echo revert\nelse\n    \u003e\u00262 echo \"Not currently rebasing, merging, cherry-picking nor reverting\"\n    exit 1\nfi\n```\n\n\u003cbr\u003e\n\n### `git get-stopped-hash`\n\n\nGets the hash of the commit that the current rebase has stopped at.\n\u003cbr\u003e_(Used in other aliases)_\n\n```bash\n# Alias for:\ncat .git/rebase-merge/stopped-sha\n```\n\n\u003cbr\u003e\n\n### `git get-unmerged-paths`\n\nGets all the unmerged file paths, relative to the current dir.\n\u003cbr\u003eFor example, user is in `/A/`, unmerged file at `/B/FILE`, return `../B/FILE`.\n\u003cbr\u003e_(Used in other aliases)_\n\n```bash\n# Alias for:\ngit diff --name-only --diff-filter=U\n# Then convert to be relative to current dir.\n```\n\n\u003cbr\u003e\n\n### `git has-unmerged`\n\nChecks if there's any unmerged paths, which somehow can occur when `.git/MERGE_HEAD` doesn't exist.\n\u003cbr\u003e_(eg. during merge conflicts after applying a stash)_\n\u003cbr\u003e_(Used in `git get-in-prog-cmd`)_\n\n```bash\n# Alias for:\ngit ls-files --unmerged | grep -q .\n\n# Usage:\nif git has-unmerged; then\n...\n```\n\n\u003cbr\u003e\n\n### `git is-ancestor [older_commit/branch] [newer_commit/branch]`\n\nChecks if `[older_commit/branch]` is an ancestor of `[newer_commit/branch]`.\n\u003cbr\u003e_(Used in conditional statements for other aliases)_\n\n```bash\n# Alias for:\ngit merge-base --is-ancestor [older_commit/branch] [newer_commit/branch]\n\n# Usage:\nif git branch-exists origin/master HEAD; then\n...\n```\n\n\u003cbr\u003e\n\n### `git is-cherry-picking`\n\nChecks if is currently cherry-picking, by checking if the `.git/CHERRY_PICK_HEAD` file exists.\n\u003cbr\u003e_(Used in `git get-in-prog-cmd`)_\n\n```bash\n# Usage:\nif git is-cherry-picking; then\n...\n```\n\n\u003cbr\u003e\n\n### `git is-merging`\n\nChecks if is currently merging, by checking if the `.git/MERGE_HEAD` file exists.\n\u003cbr\u003e_(Used in `git get-in-prog-cmd`)_\n\n```bash\n# Usage:\nif git is-merging; then\n...\n```\n\n\u003cbr\u003e\n\n### `git is-rebasing`\n\nChecks if is currently rebasing, by checking if the `.git/rebase-merge` folder exists.\n\u003cbr\u003e_(Used in `git get-in-prog-cmd`)_\n\n```bash\n# Usage:\nif git is-rebasing; then\n...\n```\n\n\u003cbr\u003e\n\n### `git is-reverting`\n\nChecks if is currently reverting, by checking if the `.git/REVERT_HEAD` file exists.\n\u003cbr\u003e_(Used in `git get-in-prog-cmd`)_\n\n```bash\n# Usage:\nif git is-reverting; then\n...\n```\n\n\u003cbr\u003e\n\n### `git restore-deleted-branch [merge_commit_hash]`\n\nRestores a locally-deleted branch from a merge commit, and returns `[branch_name]`.\n\nInfers the deleted `[branch_name]` from the merge commit's subject.\n\u003cbr\u003e_(expects the merge commit's subject to be in the form: \"Merge branch '`[branch_name]`' ...\")_\n\n```bash\n# Alias for:\ngit branch [branch_name] [merge_commit_hash]^2\necho [branch_name]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevitanrelta%2Fgitconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevitanrelta%2Fgitconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevitanrelta%2Fgitconfig/lists"}