Git worktree: Getting Started + Fast Switching

preview_player
Показать описание
Git worktree lets you work on multiple branches at once for a given git repository by creating multiple instances of it. ⚡

References 🕵️

Come and Say Hi! 🙌
Website:
GitHub:
Twitter:

Timestamps:
00:00 - Introduction
00:10 - Git Stash Workflow
01:21 - Git Worktree Flow
03:17 - Git Worktree Switcher
04:21 - Custom Branch Name
05:15 - Track Remote Branch
06:56 - Removing Worktree
07:14 - Resources to Get Started
Рекомендации по теме
Комментарии
Автор

If you are using VS Code, I can really recommend using the Git Worktree extension so handle these things for you. And, I can really *really* recommend creating a bare repo of your repo, and add your worktrees from that. It keeps a simpler, and more clean workflow. Enjoy!

sebkolind
Автор

How can I do if I'm working with a compiler ? I need to turn of the server everytime I switch branches?

oscarcastillejo
Автор

One problem I am seeing with this.. (you may yet adress it in the vid, as I am still watching; I would wait til the end, but can't hold a thought that long) anyway, does this type of workflow not lead to merge conflicts? It would be entirely on the user to keep track of what branch holds the last changes to each file (or worse, to each patch), what branch is currently being altered, etc.

Obviously, this is already the user's responsibility, but is only a concern when switching branches. I personally avoid switching as much as possible, just because I've had countless instances in the past where I would spend an entire day making and committing changes before realizing that I am on the wrong branch.

I would think that these issues would become more common when multiple branches are open at the same time. Have you had any such experiences.

BTW, thanks again for the helpful content!

nathantoulbert
Автор

@Yankee Maharjan what color theme is this?

liminal
Автор

Awesome tutorial. It would be better if you rename wt to something else like git-wt as the name wt is used by Windows Terminal already

NishithSavla
Автор

Great video! Just one quick question.. why were you making hypothetical edits to the Master branch in the first place!?!?!? JK Thank you for the excellent content. The life of a programmer would be a lot more painful and much less efficient without channels/videos like this one, so thanks again!!!

nathantoulbert