cd ~/.config
git clone [email protected]:fprochazka/gitconfig.gitInclude configs using a ~/.gitconfig
[include]
path = /home/fprochazka/.config/gitconfig/config/main.gitconfig
[user]
name = your-name
email = your-email
signingkey = 123456789123456798123456789
[init]
defaultBranch = main
[includeIf "gitdir:/home/fprochazka/devel/my-company/"]
path = /home/fprochazka/devel/my-company/.gitconfiggit clone [email protected]:git/git.gitcd git/contrib/diff-highlightmakesudo mv diff-highlight /usr/local/bin/diff-highlight
To use git issue-branch and git issue-mr commands, configure your issue tracking system:
[issue-tracking]
system = linear # Supported: linear (more coming)
linearToken = lin_api_xxxxxxxxxx # Or use LINEAR_API_TOKEN env varPer-company configuration works via includeIf:
# In /home/user/devel/my-company/.gitconfig
[issue-tracking]
linearToken = lin_api_company_tokenThis gitconfig provides many custom git commands and aliases for enhanced productivity:
git start- Initialize repository with an initial empty commit
git h- Print history of current branch without pager (useful for terminal output)git get-main-branch- Auto-detect main branch name (masterormain)git get-main-upstream-branch- Get upstream branch name (upstream/mainororigin/main)git get-current-branch- Get current branch name, even during rebase
git wip- Stage all changes and commit as "WIP [ci skip]"git unwip- Undo the last WIP commit (reset HEAD~1)
git cif- Commit as fixup to the latest non-fixup commitgit cifi- Interactive fixup commit selectiongit slurp- Move staged changes to previous commit (amend with unstaging)git aiu- Track AI usage in commits by managing author and Co-authored-by metadata
git com- Checkout main branch, pull, and also rungit cleanupgit cleanup- Fetch all remotes, prune, and drop merged/gone branchesgit branches-merged-list- List local branches merged into maingit branches-merged-drop- Delete cleanly merged branchesgit branches-gone-list- List branches whose remotes are gonegit branches-gone-drop- Delete branches with gone remotes
git branches-stacked-list- List branches containing commits from current branchgit fpush-stack- Force-push all branches updated by rebase --update-refs
git up- Stash changes, fetch, and pull from upstreamgit pu- Runupcommand then push main branch to upstreamgit permission-reset- Reset file permissions to match repository
git find <pattern>- Find files in repository by name patterngit cf <commit>- Show files changed in a commit
git sync-all-repos [dir]- Recursively sync all git repositories in directorygit gitlab-clone-all- Clone all repositories from a GitLab group (usesglabCLI for auth)git github-clone-all --org=ORG- Clone all repositories from a GitHub organization including wikis (usesghCLI for auth)git remote-host-provider [remote]- Detect if remote is GitHub or GitLab (cached)git upstream-info [--name-only]- Show if origin is a fork and what the parent repo is
git mr-status [branch]- Show MR/PR status for current branch (GitLab and GitHub)git pr-status [branch]- Alias formr-status
git issue-branch <issue-id>- Create or checkout a branch for an issue (e.g.,fp/ENG-123-fix-login-bug)git issue-branch -w <issue-id>- Same as above but creates a git worktree at<project>-worktrees/<branch-dir>git issue-mr [issue-id]- Push branch and create GitLab MR / GitHub PR with issue titlegit worktree-cleanup- Interactive worktree removal with branch info (upstream status, commit message)
These commands integrate with issue tracking systems (currently Linear) to:
- Fetch issue title for branch naming and MR/PR titles
- Auto-detect GitLab vs GitHub and use appropriate CLI (
glab/gh) - Check for existing open MR/PR before creating duplicates
- Create as draft with "remove source branch after merge" and auto-assign to you
Run shellcheck on all scripts:
make lint # Check with warning severity
make lint-all # Check with style severity (stricter)make test # Bash syntax check on all scripts
make test-help # Verify all scripts respond to --help- shellcheck - Install via
apt install shellcheckorbrew install shellcheck