Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Why use git worktree?

Posted on Aug 21 git worktree is a command that I came across the first time today while browsing the git documentation. The example section explains a possible use case pretty well:From https://git-scm.com/docs/git-worktree: You are in the middle of a refactoring session and your boss comes in and demands that you fix something immediately. You might typically use git-stash to store your changes away temporarily, however, your working tree is in such a state of disarray (with new, moved, and removed files, and other bits and pieces strewn around) that you don’t want to risk disturbing any of it. Instead, you create a temporary linked worktree to make the emergency fix, remove it when done, and then resume your earlier refactoring session.While I'm not sure if the above scenario is something where I would use it, I can see it as a useful feature for experimenting. For example, I might have a half working solution that I could stash, but if I want to switch between one approach and another idea that I have, then I think using work trees would work much better (saves me from having to keep committing code that I'm not sure will work). What do you think? Have you used git worktree?Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse Pradumna Saraf - Jul 28 Lucy Linder - Aug 1 Codeziper - Aug 1 Rajasegar Chandran - Jul 31 Once suspended, Programmingdecoded will not be able to comment or publish posts until their suspension is removed. Once unsuspended, programmingdecoded will be able to comment and publish posts again. Once unpublished, all posts by programmingdecoded will become hidden and only accessible to themselves. If programmingdecoded is not suspended, they can still re-publish their posts from their dashboard. Note: Once unpublished, this post will become invisible to the public and only accessible to Philip Perry. They can still re-publish the post if they are not suspended. Thanks for keeping DEV Community safe. Here is what you can do to flag programmingdecoded: programmingdecoded consistently posts content that violates DEV Community's code of conduct because it is harassing, offensive or spammy. Unflagging programmingdecoded will restore default visibility to their posts. DEV Community — A constructive and inclusive social network for software developers. With you every step of your journey. Built on Forem — the open source software that powers DEV and other inclusive communities.Made with love and Ruby on Rails. DEV Community © 2016 - 2023. We're a place where coders share, stay up-to-date and grow their careers.



This post first appeared on VedVyas Articles, please read the originial post: here

Share the post

Why use git worktree?

×

Subscribe to Vedvyas Articles

Get updates delivered right to your inbox!

Thank you for your subscription

×