Git #worktree allows developers to work on multiple branches simultaneously without stashing changes or switching contexts. You can switch between branches by changing directories. BONUS: Worktrees are a great way to work with AI Agents, too.
Git #worktree allows developers to work on multiple branches simultaneously without stashing changes or switching contexts. You can switch between branches by changing directories. BONUS: Worktrees are a great way to work with AI Agents, too.
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.
https://github.com/wolf/dotfiles/blob/main/git/dot-config/git/bin/make-worktree.py
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.
Git worktree cho phép làm việc đồng thời trên nhiều nhánh trong cùng dự án AI, giảm việc chuyển đổi ngữ cảnh khi chạy training, tiền xử lý dữ liệu hay sửa lỗi. Tuy nhiên cú pháp phức tạp nên tôi tạo công cụ **gwt** giúp quản lý worktree nhanh hơn: liệt kê, tạo, chuyển, xóa nhánh chỉ bằng lệnh ngắn gọn và hỗ trợ autocomplete. #git #worktree #AI #devtools #programming #côngcụ #pháttriển #lậptrình
https://dev.to/konstantin/handling-multiple-branches-in-ai-projects-with-git-worktree-40pn
Вы больше не новичок в Git. Повышаем квалификацию с помощью 7 команд
Каждому разработчику когда-нибудь приходилось срочно переключаться между ветками, восстанавливать потерянный коммит или аккуратно вырезать одно исправление. Это можно делать примитивно с помощью базовых команд Git, но настоящий профессионал отличается от любителя тем, что применяет самые оптимальные решения, тем самым экономит время и нервы. О таких решениях поговорим далее в статье.
#git #github #git_команды #гит #фичи #worktree #tig #алиас #git_rebase #ruvds_статьи
Вы больше не новичок в Git. Повышаем квалификацию с помощью 7 команд
Каждому разработчику когда-нибудь приходилось срочно переключаться между ветками, восстанавливать потерянный коммит или аккуратно вырезать одно исправление. Это можно делать примитивно с помощью базовых команд Git, но настоящий профессионал отличается от любителя тем, что применяет самые оптимальные решения, тем самым экономит время и нервы. О таких решениях поговорим далее в статье.
https://habr.com/ru/companies/ruvds/articles/978320/
#git #github #git_команды #гит #фичи #worktree #tig #алиас #git_rebase #ruvds_статьи
Figured it out using this blog post as a blueprint: https://mskelton.dev/bytes/20230906143340 Once I setup my post-checkout hook I pretty easily update the shell script to copy the needed files.
I also had to configure global git hooks with something like: git config --global core.hooksPath /Users/gfox/.git/hooks/
I did add some magic to check the source repo and if it was the rails project copy just the config files I need.
#git #worktree #hook https://mstdn.ca/@muddylaces/115634115206796183
Worktree is the wholly Canadian (Montreal) GitHub replacement. Started there a couple of weeks ago.
The site is built and run by BlackieOps owned by Alex Black. I found it a tad awkward blackieops listed GitHub as the home to all their repos, not worktree.
I have a #git #worktree question for the masses. What is the best way to handle core configuration for a project when a new worktree is added? For example, in a Rails project, when creating a worktree I then need to copy over the application.development.yml and the database.yml to be able to do anything with the code.
Is there a best practice to follow? #AskMastodon
Je réalise que j'ai oublié de poster la vidéo de ma présentation au dernier #humantalks à #grenoble. Je parle de #git, plus précisément des #worktree, de #bisect et #revert.
Ça dure 6mn de live démo, et avec les questions on est à 12mn. Et merci @PacoVelobs pour le caméo !
#tmux windows and #git #worktree Absolute gamechanger.
Working on adding a feature to a codebase, but also updating in parallel the documentation on adding new features. Working on a remote machine.
One worktree for each task in a separate window. I read the docs, hop to the other window/worktree, add the feature, hop back to the docs and update what I had to do differently.
I do realise this is a pretty simple and obvious solution, just made a difference for me today so thought I'd share.
I was busy with deploying a website this week, but guess what, more articles for y'all!
https://bojidar-bg.dev/blog/2025-10-24-bare-git-cicd/
This one is about everything I learned about using a bare git repository with hooks to automate deployment. ✨ Git hooks are awesome!!
整理了三種透過 GitHub Action 部署 Material for MkDocs 方式,其中一種用到從未用過的 git-worktree 指令,建立靜態文件來說,Material for #MkDocs 很好用! #worktree #git #github
https://note.toomore.net/2025/10/mkdocs-material-on-github-actions/
Just recently started using #git's #worktree feature, and now I wish I did this years ago. Being able to not just view but do actual work in more than one branch in parallel — without having to stash/commit/checkout all the time.. absolutely amazing. I'm still new with this, so could be there are some things (good or bad) I have yet to discover... but at least currently this feels like the most underrated feature of git that I'm aware of.
How to use git worktree effectively with Python projects https://www.andreagrandi.it/posts/how-to-use-git-worktree-effectively-with-python-projects/
@treyhunner @webology Likewise! Worktrees are useful for projects like CPython where we have `main`, `3.14`, `3.13` branches and so on.
The guide I wrote:
https://devguide.python.org/getting-started/git-boot-camp/#git-worktree
#Git #worktree #CPython
I've started migrating my repos from Codeberg to Worktree.ca; I'll keep the Codeberg repos as mirrors.
Doing this because Worktree is Canadian, and I subscribe; I felt a little bad using a non-profit's infra even though all my stuff there is open source and my CI needs are pretty minor.
EU folks: Codeberg.org is great (Forgejo).
CA folks: Worktree.ca is great (Gitea).
Thanks to a helpful person on CodeBerg, I've finally added a Canadian code repo site to my list: https://about.worktree.ca/
I recently wrote a #blog article about multitasking with #git. Did you already know about the #worktree feature?
https://levelup.gitconnected.com/the-ultimate-guide-to-git-multitasking-58b2970b5b22
#Medium #programming #devops