Skip to content

Instantly share code, notes, and snippets.

@christian-heusel
Last active March 21, 2024 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christian-heusel/47782c587e2f79d6ab2f6188ba06aacc to your computer and use it in GitHub Desktop.
Save christian-heusel/47782c587e2f79d6ab2f6188ba06aacc to your computer and use it in GitHub Desktop.

git $stuff: Tools rund um das Arbeiten mit git

gromit

Working with other peoples stuff

  • Github: gh

  • Gitlab: glab

  • git grab / git grab-push

  • signed merge commit


Working with rebasing/cherry-picking

  • git jedi: using the force with care

    git push --force-with-lease
    
  • git smash: find the right commit to add your changes to https://github.com/anthraxx/git-smash

  • Reuse Recorded Resolution (rerere):

    $ git config --global rerere.enabled true
    $ git config --global rerere.autoUpdate true
    
  • Dinge überarbeiten:

    • git commit --amend --edit
    • git rebase -i
  • git reset --hard / git reflog


Big repositories:

Nutzvoll i.e. für linux sources, aur-repo etc.

  • git maintenance

    $ git maintenance start
    
    • gc: disabled.
    • commit-graph: hourly.
    • prefetch: hourly.
    • loose-objects: daily.
    • incremental-repack: daily.
  • Worktrees: get a separate checkout without copying the thing


Tricks for using git blame

  • blame on line range

    git blame -L 28,43 path/to/file
    
  • blame on function

    git blame -L :'class LocalFile' gitbutler-ui/src/lib/vbranches/types.ts
    
  • blame with following

    git blame -w -C -C -C
    

Editor integration

  • vim / nvim:

    • tpope/vim-fugitive
    • stsewd/fzf-checkout.vim
  • emacs: Magit (2023-10-19 Einführung in Emacs -- zekjur)

  • ...?


Project integration


Zusätzliche Resourcen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment