Git Annex Cheatsheet
git annex: Manage files with Git, without checking their contents in. When a file is annexed, its content is moved into a key-value store, and a symlink is made that points to the content. Initialize a repo with Git annex: git annex init Add a file: git annex add path/to/file_or_directory Show the current status of a file or directory: git annex status path/to/file_or_directory Synchronize a local repository with a remote:
Gitlint Cheatsheet | Git commit message linter
gitlint: Git commit message linter checks your commit messages for style. Check the last commit message: gitlint The range of commits to lint: gitlint --commits single_refspec_argument Path to a directory or Python module with extra user-defined rules: gitlint --extra-path path/to/directory Start a specific CI job: gitlint --target path/to/target_directory Path to a file containing a commit-msg: gitlint --msg-filename path/to/filename Read staged commit meta-info from the local repository: gitlint --staged For more information about git lint: https://jorisroovers.
Git Fame Cheatsheet
git fame: Pretty-print Git repository contributions. Calculate contributions for the current Git repository: git fame Exclude files/directories that match the specified regular expression: git fame --excl "regular_expression" Calculate contributions made after the specified date: git fame --since "3 weeks ago|2021-05-13" Display contributions in the specified format: git fame --format pipe|yaml|json|csv|tsv Display contributions per file extension: git fame --bytype Ignore whitespace changes: git fame --ignore-whitespace Detect inter-file line moves and copies:
Git Imerge Cheatsheet
git imerge: Perform a merge or rebase between two Git branches incrementally. Conflicts between branches are tracked down to pairs of individual commits, to simplify conflict resolution. Start imerge-based rebase (checkout the branch to be rebased, first): git imerge rebase branch_to_rebase_onto Start imerge-based merge (checkout the branch to merge into, first): git imerge merge branch_to_be_merged Show ASCII diagram of in-progress merge or rebase: git imerge diagram Continue imerge operation after resolving conflicts (git add the conflicted files, first):
bfg Cheatsheet
bfg : Remove large files or passwords from Git history like git-filter-branch. Note: if your repository is connected to a remote, you will need to force push to it. Remove a file with sensitive data but leave the latest commit untouched: bfg --delete-files file_with_sensitive_data Remove all text mentioned in the specified file wherever it can be found in the repository’s history: bfg --replace-text path/to/file.txt More information: https://rtyley.github.io/bfg-repo-cleaner/ . I hope this post helps you.
Git Filter Repo Cheatsheet
git filter-repo is a versatile tool for rewriting Git history. Replace a sensitive string in all files: git filter-repo --replace-text <(echo 'find==>replacement') Extract a single folder, keeping history: git filter-repo --path path/to/folder Remove a single folder, keeping history: git filter-repo --path path/to/folder --invert-paths Move everything from sub-folder one level up: git filter-repo --path-rename path/to/folder/: To remove large files or passwords from Git history, check bfg . More information: https://github.com/newren/git-filter-repo .
Git Sizer Cheatsheet
git sizer: Computes various Git repository size metrics and alerts you to any that might cause problems or inconvenience. Report only statistics that have a level of concern greater than 0: git sizer Report all statistics: git sizer -v See additional options: git sizer -h For more info, check its repo: https://github.com/github/git-sizer . I hope this post helps you. If you know a person who can benefit from this information, send them a link of this post.
Gitsome Cheatsheet
gitsome: A terminal-based interface for GitHub, accessed via the gh command. It also provides menu-style autocomplete suggestions for git commands. Enter the gitsome shell (optional), to enable autocompletion and interactive help for Git (and gh) commands: gitsome Setup GitHub integration with the current account: gh configure List notifications for the current account (as would be seen in https://github.com/notifications ): gh notifications List the current account’s starred repos, filtered by a given search string:
GitUI Cheatsheet
gitui: Terminal UI for Git. Specify the color theme (defaults to theme.ron): gitui --theme theme Store logging output into a cache directory: gitui --logging Use notify-based file system watcher instead of tick-based update: gitui --watcher Generate a bug report: gitui --bugreport Use a specific Git directory: gitui --directory path/to/directory Use a specific working directory: gitui --workdir path/to/directory Display help: gitui --help Display version: gitui --version More information: https://github.com/extrawurst/gitui . I hope this post helps you.
Github Label Sync Cheatsheet
github-label-sync: A command-line interface for synchronizing GitHub labels. Synchronize labels using a local labels.json file: github-label-sync --access-token token repository_name Synchronize labels using a specific labels JSON file: github-label-sync --access-token token --labels url|path/to/json_file repository_name Perform a dry run instead of actually synchronizing labels: github-label-sync --access-token token --dry-run repository_name Keep labels that aren’t in labels.json: github-label-sync --access-token token --allow-added-labels repository_name Synchronize using the GITHUB_ACCESS_TOKEN environment variable: github-label-sync repository_name More information: https://github.com/Financial-Times/github-label-sync .