home.social

#worktree — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #worktree, aggregated by home.social.

  1. I use #Git. A feature of Git I leverage heavily is #Worktree. I usually have at least four around at a time. For small tasks, sure, a simple branch and then switch back, but bigger things: a worktree.

    Making a worktree is actually annoying for me: not just the upfront decisions about branches and start points and where to put the new directory (and also immediately `cd`ing there: but getting all the #submodules (submodules suck by the way), hooking up `.envrc` if you use #Direnv (and you should be), which should then set up your virtual environment and path and stuff. Clone isn’t quite as bad but has some of the same problems.

    I do this so often, I wrote a script. It might be useful to others with this workflow. It’s opinionated, and therefore I could really use some feedback! What did I do right? What did I do that’s only right for me? What is totally missing?

    The script is stand-alone, though you do need #UV. (You don’t even need Python! `uv` will transparently get you everything!) Just download this one Python file, and get it on your `$PATH`. If you want the additional `cd` behavior, then add the shell function, too as described in the `README`. Everything is tested. The tests are right there, too.

    github.com/wolf/dotfiles/blob/

    The `README.md` is right next to it.

    I **do** see one thing I’m missing: I need to provide a way to automatically copy in your custom stuff. I’ll add that today.

  2. Вы больше не новичок в Git. Повышаем квалификацию с помощью 7 команд

    Каждому разработчику когда-нибудь приходилось срочно переключаться между ветками, восстанавливать потерянный коммит или аккуратно вырезать одно исправление. Это можно делать примитивно с помощью базовых команд Git, но настоящий профессионал отличается от любителя тем, что применяет самые оптимальные решения, тем самым экономит время и нервы. О таких решениях поговорим далее в статье.

    habr.com/ru/companies/ruvds/ar

    #git #github #git_команды #гит #фичи #worktree #tig #алиас #git_rebase #ruvds_статьи