Git worktree add

>git worktree add
>work on multiple branches
>job done
>git worktree remove

Attached: 99400v5s58p81.jpg (1080x1243, 56.35K)

Other urls found in this thread:

git-scm.com/docs/git-worktree
twitter.com/SFWRedditImages

>working

i know about it, but still clone every single time. don't know why, i think i just don't care.

The day I figured out how to use worktrees and discovered how easy they are to use, I truly did wonder why I haven't done it sooner.

where did you learn that ? i still have no idea how to use worktrees

>google: git worktree
>first result: git-scm.com/docs/git-worktree
just quit programming, you're not even qualified to copy-paste from stackoverflow

>c/p first google result
>woah guys look how smart i am
I'm not even a programmer lol but nice try anyway

you don't need git worktrees then. now fuck off.

>git is only used by programmers
lol retard

Attached: 121.png (568x1023, 215.7K)

I just googled it and gave it a try. It's really easy.
git worktree add ../projectname-branch somebranch
This will create a directory ../projectname-branch and checkout somebranch in it. Your current directory will stay on master or whatever other branch you were on. You can now switch between branches of the project by switching directories, so you can work on multiple branches at the same time without having to commit/stash everything every time you switch. Why is this better than cloning a repo multiple times? Because both directories share the same git object repo, so you can merge branches from one directory into the other, and if you have a very large repo it's a lot faster becausw you're not making a copy of the entire history. When you're done, git worktree remote ../projectname-branch.

>gets paid

I don't know how to use git outside commit and push

thank you based quads

this, worktards are trully retarded

>When you're done, git worktree remote ../projectname-branch
huh...? "worktree remote" or "worktree remove"?

>accidentally type “git workpee add”
>boss is given an alert “user tried to pee on his work!”

>changing directories for a new branch
I doubt that intellij will handle this well.

I don't see why you don't just keep the branches and switch between them in the same directory? this is faster how? because branch switching is pretty damn fast tbqh.

or is OP larping as an employed programmer??

I always build in the git directory. so ie if I run a debug build on branch X, and another on branch Y, it's overwritten. I currently just clone bc our work is on dated af git, but worktree sounds very nice.

Yeah, that was supposed to be remove. My git muscle memory is weird.

>t. neet