Learn Git Tutorial: What is Git worktree?

preview_player
Показать описание
The Git worktree command allows you to checkout and work in multiple Git branches simultaneously. This video will provide a visual explanation of the concept before showing how to manage worktrees easily with GitKraken Desktop.

#git #learngit #gitworktree #gitkraken #beginnergit
Рекомендации по теме
Комментарии
Автор

Love that this feature is finally in GitKraken! Worktrees are a pretty big part of my workflow, it really helps with reviewing team member PRs. I switched to lazygit because of worktrees but looks like I'll switch back to GitKraken with this because I love the UI. Great work!

rdwok
Автор

Love that you're constantly innovating and rethinking the most efficient ways to do work. I'm still struggling to understand how this is different from stash/pop tbh despite the comments. I'd love to see a clearer demo.

aminnaggar
Автор

The demo is nice, but it doesn't show you actually have to open a new directory in your IDE.
That means more work and confusion than stash+pop.
Only useful if you're editing from GK IMO.
It also doesn't prune empty ".worktrees" directory once all worktrees are deleted.

gdlx
Автор

Confusing tutorial, sorry guys, we expected better example:D

Stash + pop work flow seems straight forward and hastle free I guess

OmarAhmed-rgii
Автор

I'm a little confused. Wouldn't you still need to rebase your new Feature branch off of Main after you merged the Hotfix? I'm not sure what the advantages are of worktrees are when compared to the stash/pop method.

davidlevin_
Автор

A lot of negativity in the comments here, I think it's a bit unfair to call this an alternative to stash though. At least stashes stayed visually tied to branches in GitKraken and are a great way to work. Needing a new directory means I need to install dependencies again etc.. etc... So this does feel like an extremely niche situation where - maybe one branch is on a different version of node for example, or relies on a new version of a dependency with breaking changes in code. In that case, this would be nicer than re-cloning the repo to a new folder. But only if I'm going to be switching back-and-forth regularly, which is also rare. Probably more common for library developers though - I bet this is a nice feature for long-term-support versions of libraries to back-port fixes and new features.

cintrond
Автор

I personally am very happy to have separate local repos to work on different branches

matthewwynn
Автор

I have to agree with the commenters here. Love that you are working on interesting features, but stash and pop seems way more efficient.
I have a huge repo and can't casually copy and paste the entire repo for a new worktree. It just isn't effective.

rafaeldolfe
Автор

Literally takes more steps than stashing and popping

sjoerdvandegoor
Автор

I have a question about starting a work tree from a working tree entry point. How can commit to the repo from the work tree and where these commits will go?

vladyn
Автор

So basically this is a more confusing alternative to working with multiple workspaces? What am I missing here?

andreizissu
Автор

I'm in a similar pickle as others. I work in a MASSIVE repo and casually duplicating it is more time/effort than stash and pop. I agree that stash and pop is somewhat jarring when you're in the flow, but unless your repo is small it still feels like the only reasonable solution. I like the _option_ but it's not for me.

JamesSheridan
Автор

I'm a bit confused. This doesn't seem to be working on bare repos as practically everyone is using it. Am I missing something and if so why is it not working on bare repos?

bendecaf_
Автор

Sounds frightening. I won't be going anywhere near it.

craigstevens
Автор

You lost me at the word "directory". Bye.

FrankBrakerLTI
visit shbcf.ru